From c3385cb6fba4f40884df1cfb7f7c84b608cf54bc Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期日, 11 九月 2022 20:35:56 +0800
Subject: [PATCH] #

---
 /dev/null                        |  318 ---------------------------------------------
 src/main/webapp/views/login.html |   59 ++++++++
 2 files changed, 57 insertions(+), 320 deletions(-)

diff --git a/src/main/webapp/views/login.html b/src/main/webapp/views/login.html
index 6d5a1cb..ca583fe 100644
--- a/src/main/webapp/views/login.html
+++ b/src/main/webapp/views/login.html
@@ -24,7 +24,7 @@
         width: 20%;
         height: 95%;
         /*鐗规晥*/
-        background: rgba(255,255,255,0.6);
+        background: rgba(255, 255, 255, 0.5);
         border-radius: 5px;
         color: #ffffff;
         z-index: 99;
@@ -64,7 +64,7 @@
         <h2 class="p-sketch-outline__title">Customer Relationship Management</h2>
         <p class="p-sketch-outline__date">posted: 2018.01.01 / update: 2022.03.18
         </p>
-        <p class="p-sketch-outline__description">wcs made with various simple objects.</p>
+        <p class="p-sketch-outline__description">crm made with various simple objects.</p>
       </div>
       <canvas class="p-canvas-webgl" id="canvas-webgl"></canvas>
 
@@ -103,6 +103,61 @@
     <script type="text/javascript" src="../static/layer/layer.js"></script>
     <script type="text/javascript" src="../static/js/common.js"></script>
     <script>
+      // remember pwd
+      $(function () {
+        var oldUserName = localStorage.getItem('oldUserName');
+        var oldPass = localStorage.getItem('oldPass');
+        if(oldUserName){
+          $('#username').val(oldUserName);
+        }
+        if(oldPass){
+          $('#password').val(oldPass);
+        }
+      })
+
+      window.onload = function(){document.getElementById("username").focus();}
+
+      $(document).on('click','.login-btn', function () {
+        let username = $("#username").val();
+        if (username === "") {
+          layer.tips('璇疯緭鍏ョ櫥褰曡处鍙�', '#username', {tips: [4, '#ff0000']});
+          return;
+        }
+        let password = $("#password").val();
+        if (password === "") {
+          layer.tips('璇疯緭鍏ュ瘑鐮�', '#password', {tips: [4, '#ff0000']});
+          return;
+        }
+        $.ajax({
+          url: baseUrl+"/login.action",
+          data: {
+            username: username,
+            password: hex_md5(password)
+          },
+          method: 'POST',
+          success: function (res) {
+            if (res.code === 200){
+              localStorage.setItem("token", res.data.token);
+              localStorage.setItem("username", res.data.nickname);
+              window.location.href = "index.html";
+            } else if (res.code === 10001) {
+              layer.tips(res.msg, '#username', {tips: [4, '#ff0000']});
+            } else if (res.code === 10002) {
+              layer.tips(res.msg, '#username', {tips: [4, '#ff0000']});
+            } else if (res.code === 10003) {
+              layer.tips(res.msg, '#password', {tips: [4, '#ff0000']});
+            } else {
+              layer.tips(res.msg, '.login-btn', {tips: [3, '#ff0000']});
+            }
+          }
+        });
+      });
+
+      $('body').keydown(function () {
+        if (event.keyCode === 13) {
+          $(".login-btn").click();
+        }
+      });
     </script>
   </body>
 </html>
diff --git a/src/main/webapp/views/login0.html b/src/main/webapp/views/login0.html
deleted file mode 100644
index 15f9642..0000000
--- a/src/main/webapp/views/login0.html
+++ /dev/null
@@ -1,318 +0,0 @@
-
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <title>WMS绠$悊绯荤粺 - 鐧诲綍</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-    <meta http-equiv="Access-Control-Allow-Origin" content="*">
-    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
-    <meta name="apple-mobile-web-app-status-bar-style" content="black">
-    <meta name="apple-mobile-web-app-capable" content="yes">
-    <meta name="format-detection" content="telephone=no">
-    <link rel="icon" type="image/x-icon" href="../static/image/logo1.png" />
-    <link rel="stylesheet" href="../static/layui/css/layui.css" media="all">
-    <link rel="stylesheet" href="../static/css/admin.css?v=318">
-    <link rel="stylesheet" href="../static/css/loader.css" media="all">
-    <!--[if lt IE 9]>
-    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
-    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
-    <![endif]-->
-    <style>
-        html, body {width: 100%;height: 100%;overflow: hidden}
-        body {background: #1E9FFF;}
-        body:after {content:'';background-repeat:no-repeat;background-size:cover;-webkit-filter:blur(3px);-moz-filter:blur(3px);-o-filter:blur(3px);-ms-filter:blur(3px);filter:blur(3px);position:absolute;top:0;left:0;right:0;bottom:0;z-index:-1;}
-        .layui-container {width: 100%;height: 100%;overflow: hidden}
-        .admin-login-background {width:360px;height:300px;position:absolute;left:50%;top:40%;margin-left:-180px;margin-top:-100px;}
-        .logo-title {text-align:center;letter-spacing:2px;padding:14px 0;}
-        .logo-title h1 {color:#1E9FFF;font-size:25px;font-weight:bold;}
-        .login-form {background-color:#fff;border:1px solid #fff;border-radius:3px;padding:14px 20px;box-shadow:0 0 8px #eeeeee;}
-        .login-form .layui-form-item {position:relative;}
-        .login-form .layui-form-item label {position:absolute;left:1px;top:1px;width:38px;line-height:36px;text-align:center;color:#d2d2d2;}
-        .login-form .layui-form-item input {padding-left:36px;}
-        .captcha {width:60%;display:inline-block;}
-        .captcha-img {display:inline-block;width:34%;float:right;}
-        .captcha-img img {height:34px;border:1px solid #e6e6e6;height:34px;width:100%;}
-
-
-        .layui-container {
-            margin: 0;
-            padding: 0;
-            width: 78%;
-        }
-        .side {
-            position: relative;
-            float: left;
-            width: 22%;
-            height: 100%;
-            background-color: #f8f8f8;
-            box-shadow: 0 0 3px #eeeeee;
-        }
-        .banner {
-            position: absolute;
-            top: 40%;
-            width: 100%;
-            height: 350px;
-            transform:translateY(-50%);
-            -webkit-transform:translateY(-50%);  /*鍏煎-webkit-寮曟搸娴忚鍣�*/
-            -moz-transform:translateY(-50%);     /*鍏煎-moz-寮曟搸娴忚鍣�*/
-        }
-        #item-img {
-            background-size: 100% 100%;
-            width: 100%;
-            height: 100%;
-            transition: 0.5s;
-        }
-        .img-1 {
-            background-image: url(../static/image/loginSide1.png);
-        }
-        .img-2 {
-            background-image: url(../static/image/loginSide2.png);
-        }
-        .desc p {
-            padding: 0 35px;
-            font-size: 20px;
-            color: rgba(59, 73, 156, 0.95);
-            font-family: 'Bahnschrift',serif !important;
-        }
-        .loginbm {
-            color: #0b3a58;
-            font: 12px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial, sans-serif;
-            height: 32px;
-            line-height: 32px;
-            text-align: center;
-            background: url(../static/image/loginbg2.png) repeat-x;
-            position: absolute;
-            bottom: 0;
-            width: 100%;
-        }
-        #pda-content {
-            z-index: 1;
-            position: absolute;
-            bottom: 40px;
-            width: 100%;
-            padding: 0 20px;
-            text-align: center;
-        }
-        .qrcode-desc {
-            font-weight: bold;
-            margin-left: 10px;
-            display: inline-block;
-            font-family: 'Bahnschrift',serif;
-            font-size: 14px;
-            vertical-align: middle;
-            color: #515a6e;
-        }
-
-        .layui-form-checked[lay-skin=primary] i {
-            border-color: #1e9fff!important;
-            background-color: #1e9fff;
-            color: #fff;
-        }
-        .layui-form-checkbox[lay-skin=primary]:hover i {
-            border-color: #1e9fff;
-            color: #fff;
-        }
-    </style>
-</head>
-<body>
-<div class="side">
-    <div class="banner">
-        <div id="item-img" class="img-1"></div>
-        <div class="desc">
-            <p>
-                Warehouse Management System銆侀�氳繃瀵逛粨搴撶殑鍒嗗尯绠$悊銆侀噰鐢ㄨ揣鏋躲�佽揣浣嶇殑搴旂敤銆佽浠撳簱绠$悊鏇磋鑼冦�佷汉鍛樻嫞璐ф晥鐜囨洿楂樸��
-            </p>
-        </div>
-    </div>
-    <div id="pda-content">
-        <img id="pda-link" src="" width="50px">
-        <div class="qrcode-desc">
-            <div>PDA绔�</div>
-            <div>鎵爜鐧诲綍</div>
-        </div>
-    </div>
-</div>
-<div class="layui-container">
-    <div class="admin-login-background">
-        <div class="layui-form login-form">
-            <form class="layui-form" action="">
-                <div class="layui-form-item logo-title">
-                    <h1>WMS绯荤粺鐧诲綍</h1>
-                </div>
-                <div class="layui-form-item">
-                    <label class="layui-icon layui-icon-username"></label>
-                    <input type="text" id="username" name="username" placeholder="鐧诲綍璐﹀彿" autocomplete="off" class="layui-input">
-                </div>
-                <div class="layui-form-item">
-                    <label class="layui-icon layui-icon-password"></label>
-                    <input type="password" id="password" name="password" placeholder="璇疯緭鍏ョ櫥褰曞瘑鐮�" autocomplete="off" class="layui-input">
-                </div>
-                <div id="code-box" class="layui-form-item">
-                    <label class="layui-icon layui-icon-vercode"></label>
-                    <input type="text" id="code" name="code" placeholder="鍥惧舰楠岃瘉鐮�" autocomplete="off" class="layui-input verification captcha">
-                    <div class="captcha-img" style="margin-right: 5px">
-                        <img id="codeImg" title="鐪嬩笉娓咃紵鐐瑰嚮鎹竴寮犮��">
-                    </div>
-                </div>
-                <div class="layui-form-item">
-                    <input type="checkbox" id="rememberPwd" value="true" lay-skin="primary" title="璁颁綇瀵嗙爜">
-                </div>
-                <div class="layui-form-item">
-                    <button class="layui-btn layui-btn layui-btn-normal layui-btn-fluid" lay-submit="" lay-filter="login">鐧� 鍏�</button>
-                </div>
-            </form>
-        </div>
-    </div>
-    <div class="loginbm">鎶�鏈敮鎸侊細&nbsp;&nbsp;缁嶅叴瀛氭儬绉戞妧鏈夐檺鍏徃&nbsp;&nbsp;CopyRight@&nbsp;2021&nbsp;&nbsp;</div>
-</div>
-
-<!--鍒濆鍖栧姞杞藉眰-->
-<div class="layuimini-loader">
-    <div class="layuimini-loader-inner"></div>
-</div>
-
-<script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script>
-<script type="text/javascript" src="../static/js/jquery/jquery.particleground.min.js" charset="utf-8"></script>
-<script type="text/javascript" src="../static/js/tools/md5.js"></script>
-<script type="text/javascript" src="../static/layui/layui.js"></script>
-<script type="text/javascript" src="../static/js/common.js"></script>
-
-<script type="text/javascript">
-    console.log('%c WMS %c 1.0.0','background-color:rgb(53,73,94);color: #fff;border-radius:2px 0 0 2px;padding:2px 4px;','background-color:rgb(25,190,107);color: #fff;border-radius:0 2px 2px 0;padding:2px 4px;font: 9pt "Apercu Regular", Georgia, "Times New Roman", Times, serif;');
-    $('#pda-link').attr("src", baseUrl+"/qrcode.do?param=http://" + window.location.host+baseUrl+"/pda");
-    var codeSwitch = 'Y';
-    var oldUserName = localStorage.getItem('oldUserName');
-    var oldPass = localStorage.getItem('oldPass');
-    var rememberSwitch = localStorage.getItem('rememberSwitch');
-    var loop = true;
-    setInterval(function () {
-        if (loop) {
-            $('#item-img').attr("class", "img-1");
-            loop = false;
-        } else {
-            $('#item-img').attr("class", "img-2");
-            loop = true;
-        }
-    }, 3000);
-    // 鍔犺浇鍔ㄧ敾
-    setTimeout(function () {
-        $('.layuimini-loader').fadeOut();
-    }, 500)
-    $(document).ready(function(){
-        // 楠岃瘉鐮佸紑鍏�
-        $.ajax({
-            url: baseUrl+"/code/switch.action",
-            async: false,
-            success: function (res) {
-                if (res.data === 'N'){
-                    codeSwitch = res.data;
-                    $('#code-box').css("display", "none");
-                }
-            }
-        });
-        // 楠岃瘉鐮�
-        initCode();
-        // 绮掑瓙绾挎潯鑳屾櫙
-        $('.layui-container').particleground({
-            dotColor:'#7ec7fd',
-            lineColor:'#7ec7fd'
-        });
-        if(oldUserName){
-            $('#username').val(oldUserName);
-        }
-        if(oldPass){
-            $('#password').val(oldPass);
-        }
-        if (rememberSwitch === 'true') {
-            $('#rememberPwd').attr("checked", true);
-        }
-    });
-
-    layui.config({
-        base: baseUrl + "/static/layui/lay/modules/"
-    }).extend({
-        notice: 'notice/notice',
-    }).use(['form','layer', 'notice'],function () {
-        var form = layui.form;
-        var layer = layui.layer;
-        var notice = layui.notice;
-
-        // 杩涜鐧诲綍鎿嶄綔
-        form.on('submit(login)', function (data) {
-            data = data.field;
-            if (data.username === '') {
-                $("#username").focus();
-                notice.msg('鐧诲綍璐﹀彿涓嶈兘涓虹┖', {icon: 2});
-                return false;
-            }
-            if (data.password === '') {
-                $("#password").focus();
-                notice.msg('瀵嗙爜涓嶈兘涓虹┖', {icon: 2});
-                return false;
-            }
-            if (data.code === '' && codeSwitch === 'Y') {
-                $("#code").focus();
-                notice.msg('楠岃瘉鐮佷笉鑳戒负绌�', {icon: 2});
-                return false;
-            }
-            if (sessionStorage.getItem("code").toUpperCase() !== data.code.toUpperCase() && codeSwitch==='Y'){
-                $("#code").focus();
-                notice.msg('楠岃瘉鐮侀敊璇�', {icon: 2});
-                return false;
-            }
-            var user = {
-                username: data.username,
-                password: hex_md5(data.password)
-            };
-            $.ajax({
-                url: baseUrl+"/login.action",
-                data: user,
-                method: 'POST',
-                success: function (res) {
-                    if (res.code === 200){
-                        // 璁颁綇瀵嗙爜
-                        if($('#rememberPwd').is(':checked')){
-                            localStorage.setItem('oldUserName', user.username);
-                            localStorage.setItem('oldPass', data.password);
-                            localStorage.setItem('rememberSwitch', true);
-                        } else {
-                            localStorage.removeItem('oldUserName');
-                            localStorage.removeItem('oldPass');
-                            localStorage.setItem('rememberSwitch', false);
-                        }
-                        localStorage.setItem("token", res.data.token);
-                        localStorage.setItem("nickname", res.data.nickname);
-                        window.location.href = "index.html";
-                    } else {
-                        notice.msg(res.msg, {icon: 2});
-                    }
-                }
-            });
-            return false;
-        });
-    });
-
-
-    // 鍒濆鍖栭獙璇佺爜
-    $('#codeImg').click(function () {
-        initCode();
-    });
-    function initCode() {
-        var random = Math.random();
-        $('#codeImg').attr("src", baseUrl+"/code.action?sd="+random);
-        setTimeout(function () {
-            $.ajax({
-                url: baseUrl+"/code.do",
-                data: {sd: random},
-                method: 'POST',
-                async: false,
-                success: function (code) {
-                    sessionStorage.setItem("code", code);
-                }
-            });
-        }, 100);
-    }
-</script>
-</body>
-</html>

--
Gitblit v1.9.1