| | |
| | | box-sizing:border-box; |
| | | background: #fff; |
| | | height: 100%; |
| | | padding: 60px 40px; |
| | | padding: 100px 60px; |
| | | text-align: center; |
| | | overflow: hidden; |
| | | } |
| | |
| | | position: relative; |
| | | } |
| | | .layui-form-item .layui-input { |
| | | height: 30px; |
| | | height: 40px; |
| | | padding-left: 20px; |
| | | font-size: 14px; |
| | | font-size: 16px; |
| | | border: 1px solid #767676; |
| | | color: inherit; |
| | | border-radius: 3px; |
| | |
| | | form.on('submit(login)', function (data) { |
| | | var mobile = $("#mobile").val(); |
| | | if (mobile === "") { |
| | | alert("请输入手机号"); |
| | | layer.msg("请输入账号", {icon: 2}) |
| | | $("#mobile").focus(); |
| | | return; |
| | | } |
| | | var password = $("#password").val(); |
| | | if (password === "") { |
| | | alert("请输入密码"); |
| | | layer.msg("请输入密码", {icon: 2}) |
| | | $("#password").focus(); |
| | | return; |
| | | } |
| | | |
| | |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.msg("登录成功", {icon: 1}) |
| | | localStorage.setItem("token", res.data.token); |
| | | localStorage.setItem("username", res.data.username); |
| | | window.location.href = "index.html"; |
| | | } else { |
| | | alert(res.msg); |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | |
| | | $('body').keydown(function () { |
| | | if (event.keyCode === 13) { |
| | | $("#login-button").click(); |
| | | } else if (event.keyCode === 115) { |
| | | $("#login-button").click(); |
| | | } |
| | | }); |
| | | |