| | |
| | | <title>系统登录</title> |
| | | <link rel="stylesheet" href="../static/layui/css/layui.css" media="all"> |
| | | <script type="text/javascript" src="../static/layui/layui.js"></script> |
| | | |
| | | <script type="text/javascript" src="../static/js/common.js"></script> |
| | | <style> |
| | | html{ |
| | | height: 100%; |
| | |
| | | // 初始化验证码 |
| | | function initCode() { |
| | | var random = Math.random(); |
| | | $('#codeImg').attr("src", "/code.action?sd="+random); |
| | | $('#codeImg').attr("src", baseUrl+"/code.action?sd="+random); |
| | | setTimeout(function () { |
| | | $.ajax({ |
| | | url: "/code.do", |
| | | url: baseUrl+"/code.do", |
| | | data: {sd: random}, |
| | | method: 'POST', |
| | | async: false, |
| | |
| | | return; |
| | | } |
| | | var code = $("#code").val(); |
| | | // if (code === "") { |
| | | // layer.msg("请输入验证码", {offset: '150px'}); |
| | | // return; |
| | | // } |
| | | // if (sessionStorage.getItem("code").toUpperCase() !== code.toUpperCase()){ |
| | | // layer.msg("验证码错误", {offset: '150px'}); |
| | | // return; |
| | | // } |
| | | if (code === "") { |
| | | layer.msg("请输入验证码", {offset: '150px'}); |
| | | return; |
| | | } |
| | | if (sessionStorage.getItem("code").toUpperCase() !== code.toUpperCase()){ |
| | | layer.msg("验证码错误", {offset: '150px'}); |
| | | return; |
| | | } |
| | | |
| | | var user = { |
| | | mobile: mobile, |
| | | password: hex_md5(password) |
| | | }; |
| | | $.ajax({ |
| | | url: "/login.action", |
| | | url: baseUrl+"/login.action", |
| | | data: user, |
| | | method: 'POST', |
| | | success: function (res) { |