| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8"/>
- <meta name="format-detection" content="telphone=no,email=no"/>
- <meta name="viewport"
- content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
- <meta http-equiv="Pragma" content="no-cache">
- <meta http-equiv="Cache-control" content="no-cache">
- <meta http-equiv="Cache" content="no-cache">
- <title>登录</title>
- <link rel="stylesheet" href="/components/lib/mui.min.css"/>
- <link rel="stylesheet" href="/components/custom/css/common.css"/>
- <link rel="stylesheet" href="/app/css/xyf.common.min.css"/>
- </head>
- <body class="bg-white">
- <div class="input-group-card">
- <div class="input-row input-clear">
- <input id="userName" type="tel" maxlength="11" placeholder="手机号">
- </div>
- <div class="input-row input-clear">
- <input id="password" type="password" maxlength="20" placeholder="密码">
- </div>
- </div>
- <div class="subt">
- <input class="mui-btn-block" type="button" id="loginBtn" value="登录" onclick="login()">
- </div>
- <script src="/components/lib/jquery.min.js"></script>
- <script src="/components/lib/mui.min.js"></script>
- <script src="/app/js/xyf.login.js"></script>
- <script src="/components/lib/md5.js"></script>
- <script src="/components/custom/js/common.js"></script>
- <script>
- document.onkeydown = function (event) {
- if (event.keyCode == 13) {
- login();
- }
- }
- function login() {
- //检查手机号码
- var userName = $("#userName").val();
- if (!isPhone(userName)) {
- mui.toast("请输入11位正确手机号码");
- return;
- }
- //检查密码
- var password = $("#password").val();
- if (password.length < 6) {
- mui.toast("请输入正确的密码");
- return;
- }
- myAjax({
- type: "POST",
- url: "/superadmin/login",
- contentType: "json",
- data: JSON.stringify({"username": userName, "password": hex_md5(password)}),//使用JSON格式,不使用from data格式
- success: function (res) {
- if (res.result == 1) {
- var url = 'index.html';
- goPage(url);
- } else if (res.result == 0) {
- var btnArray = ['确定'];
- mui.confirm(res.description, '温馨提示', btnArray, function (e) {
- });
- } else {
- mui.alert(res.description, '温馨提示', '确定');
- }
- }
- });
- }
- </script>
- </body>
- </html>
|