From 6f7a815b2d6e4f30e7ccf901b24d5103aaa72078 Mon Sep 17 00:00:00 2001 From: zyx <zyx123456> Date: 星期一, 25 十二月 2023 10:23:08 +0800 Subject: [PATCH] Merge branch 'tzskasrs-1' of http://47.97.1.152:5880/r/zy-asrs into tzskasrs-1 --- src/main/webapp/views/login.html | 391 +++++++++++++++++++++++++------------------------------ 1 files changed, 180 insertions(+), 211 deletions(-) diff --git a/src/main/webapp/views/login.html b/src/main/webapp/views/login.html index ddcefa8..295f9c6 100644 --- a/src/main/webapp/views/login.html +++ b/src/main/webapp/views/login.html @@ -1,227 +1,196 @@ <!DOCTYPE html> <html lang="en"> -<head> - <meta charset="UTF-8"> - <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> + <head> + <meta charset="utf-8"> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> + <title>娴欐睙涓壃 鈹� login of zoneyung wms</title> + <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1"> + <meta name="description" content="study of Instancing with three.js"> + <meta name="keywords" content="undefined, Yoichi Kobayashi, WebGL, three.js"> + <meta name="theme-color" content="#111111"> + <meta name="msapplication-TileImage" content="/sketch-threejs/img/common/ms_tileimage.png"> + <meta name="msapplication-TileColor" content="#111111"> + <link rel="stylesheet" href="../static/css/font/font-awesome-4.7.0/css/font-awesome.css"> + <link rel="stylesheet" href="../static/css/main.min.css"> + <link rel="stylesheet" href="../static/css/login.css"> <style> - html{ - height: 100%; - } - body.login-bg { - color: #777; - height: 100%; - /*background-image: url("../static/image/bg-imgage.jpg");*/ - background-image: url("../static/image/login_bg.jpg"); - background-repeat: no-repeat; - background-size: cover; - background-position: top center; - } + #sidebar{ + /*瀹氫綅*/ + position: absolute; + top: 50%; + right: 1%; + transform: translateY(-50%); + width: 20%; + height: 95%; + /*鐗规晥*/ + background: rgba(255,255,255,0.6); + border-radius: 5px; + color: #ffffff; + z-index: 99; + box-shadow: 3px 3px 6px 3px rgba(0, 0, 0, .3); + } - #login-wrapper { - /*color: #fff;*/ - box-sizing:border-box; - /*background: #576669;*/ - background: #fff; - position: absolute; - top: 45%; - left: 50%; - margin-top: -210px; - margin-left: -220px; - width: 440px; - min-height: 420px; - padding: 50px; - text-align: center; - border-radius: 5px; + .login-contain { + position: relative; + width: 100%; + height: 100%; + } + .login-box { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 100%; + text-align: center; + } - transform-origin: 50% 50%; - animation: loading 1s 0s forwards; - transform: rotateX(0deg); - } - - #login-wrapper h2 { - font-size: 26px; - margin-bottom: 30px; - } - - .layadmin-user-login-body .layui-form-item { - margin-bottom: 20px; - position: relative; - } - .layadmin-user-login-body .layui-form-item .layui-input { - height: 42px; - padding-left: 40px; - font-size: 16px; - border: 1px solid #c8cccf; - color: inherit; - } - .login-submit { - margin-top: 30px; - } - .layadmin-user-login-icon { - position: absolute; - left: 1px; - top: 1px; - width: 38px; - line-height: 40px; - text-align: center; - color: #B2B2B2; - font-size: 18px; - } - .layui-btn-normal { - background-color: #0767aa; - font-size: 20px; - border-radius: 4px; - height: 52px; - } - #code-box { - position: relative; - height: 42px; - } - #code-label { - z-index: 999; - } - #code { - position: absolute; - left: 0; - top: 0; - display: inline-block; - width: 60%; - } - #codeImg { - border: 1px solid rgba(0,0,0,0.1); - position: absolute; - right: 5%; - top: 0; - width: 30%; - height: 90%; - } </style> -</head> -<body class="login-bg"> - -<div id="login-wrapper"> - <header> - <h2>绯荤粺鐧诲綍</h2> - </header> - <div class="layui-form layadmin-user-login-body"> - <div class="layui-form-item"> - <label class="layui-icon layui-icon-cellphone layadmin-user-login-icon"></label> - <input id="mobile" class="layui-input" type="text" name="mobile" lay-verify="mobile" placeholder="鐢ㄦ埛鍚�"> - </div> - <div class="layui-form-item"> - <label class="layui-icon layui-icon-password layadmin-user-login-icon"></label> - <input id="password" class="layui-input" type="password" name="password" lay-verify="password" placeholder="瀵嗙爜"> - </div> - <div id="code-box" class="layui-form-item" style=""> - <label id="code-label" class="layui-icon layui-icon-vercode layadmin-user-login-icon"></label> - <input id="code" class="layui-input" type="text" name="password" lay-verify="code" placeholder="楠岃瘉鐮�"> - <img id="codeImg" title="鐪嬩笉娓咃紵鐐瑰嚮鎹竴寮犮��"> - </div> - <!--<div class="layui-form-item">--> - <!--<input id="rememberPwd" style="vertical-align: middle" type="checkbox" lay-filter="remPwd" lay-skin="switch" lay-text="寮�鍚瘄鍏抽棴" title="璁颁綇瀵嗙爜" checked="checked">--> - <!--<span style="vertical-align: middle;font-size: 15px">璁颁綇瀵嗙爜</span>--> - <!--</div>--> + </head> + <body> + <div class="l-page l-page--white" data-id="instancing"> + <div style="position: fixed; + z-index: 100; + top: 22px; + left: 20px;"> + <img src="../static/image/logo.png" alt="" style="width: 20%"> + </div> + <div class="p-sketch-outline"> + <h2 class="p-sketch-outline__title">Automatic Storage and Retrieval System</h2> + <p class="p-sketch-outline__date">posted: 2018.01.01 / update: 2022.03.18 + </p> + <p class="p-sketch-outline__description">wms made with various simple objects.</p> + </div> + <canvas class="p-canvas-webgl" id="canvas-webgl"></canvas> </div> - <div class="layui-form-item login-submit"> - <button id="login-button" class="layui-btn layui-btn-fluid layui-btn-normal" lay-submit="" lay-filter="login">鐧� 褰�</button> + <!-- 渚ц竟鏍� --> + <div id="sidebar"> + <div class="login-contain"> + <div class="login-box"> + <img src="../static/image/logo.png" alt="" style="width: 80%"> +<!-- <span class="login100-form-title p-t-20 p-b-45">涓壃绔嬪簱</span>--> +<!-- <span class="login100-form-title p-t-20 p-b-45" style="margin: 15px 0;color: #868686;font-size: 24px">WMS</span>--> + <div class="wrap-input100 validate-input m-b-10" data-validate="璇疯緭鍏ョ敤鎴峰悕"> + <input id="username" class="input100" type="text" name="username" placeholder="username" autocomplete="off"> + <span class="focus-input100"></span> + <span class="symbol-input100"> + <i class="fa fa-user"></i> + </span> + </div> + <div class="wrap-input100 validate-input m-b-10" data-validate="璇疯緭鍏ュ瘑鐮�"> + <input id="password" class="input100" type="password" name="pass" placeholder="password"> + <span class="focus-input100"></span> + <span class="symbol-input100"> + <i class="fa fa-lock"></i> + </span> + </div> + <div class="container-login100-form-btn p-t-10"> + <button class="login100-form-btn login-btn">Login</button> + </div> + <div class="container-login100-form-btn p-t-10" style="display: none;margin-top: 50px;" id="updateLicense"> + <form enctype="multipart/form-data" style="display: none;"> + <input id="license" type="file" name="file" > + </form> + <button class="login100-form-btn" id="submitLicense">鏇存柊璁稿彲璇�</button> + </div> + </div> + </div> </div> -</div> -</body> -<script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script> -<script type="text/javascript" src="../static/js/tools/md5.js"></script> -<script type="text/javascript"> - - // 楠岃瘉鐮佸紑鍏� - var codeSwitch = 'Y'; - $.ajax({ - url: baseUrl+"/code/switch.action", - async: false, - success: function (res) { - codeSwitch = res.data; - if (codeSwitch === 'N'){ - $('#code-box').css("display", "none"); - } + <script type="text/javascript" src="../static/js/tools/main.min.js"></script> + <script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script> + <script type="text/javascript" src="../static/js/tools/md5.js"></script> + <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); + } + }) - // 鍒濆鍖栭獙璇佺爜 - initCode(); - $('#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); - } + window.onload = function(){document.getElementById("username").focus();} - layui.use(['form','layer'],function () { - var form = layui.form, - layer = layui.layer, - $ = layui.jquery; - - form.on('submit(login)', function (data) { - var mobile = $("#mobile").val(); - if (mobile === "") { - layer.msg("璇疯緭鍏ユ墜鏈哄彿", {offset: '150px'}); - return; + $(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.username); + 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 if (res.code == 20001) { + layer.tips(res.msg, '.login-btn', {tips: [3, '#ff0000']}); + $("#updateLicense").show() + } else { + layer.tips(res.msg, '.login-btn', {tips: [3, '#ff0000']}); } - var password = $("#password").val(); - if (password === "") { - layer.msg("璇疯緭鍏ュ瘑鐮�", {offset: '150px'}); - return; - } - var code = $("#code").val(); - if (code === "" && codeSwitch === 'Y') { - layer.msg("璇疯緭鍏ラ獙璇佺爜", {offset: '150px'}); - return; - } - if (sessionStorage.getItem("code").toUpperCase() !== code.toUpperCase()&&codeSwitch==='Y'){ - layer.msg("楠岃瘉鐮侀敊璇�", {offset: '150px'}); - return; - } - - var user = { - mobile: mobile, - password: hex_md5(password) - }; - $.ajax({ - url: baseUrl+"/login.action", - data: user, - method: 'POST', - success: function (res) { - if (res.code === 200){ - localStorage.setItem("token", res.data.token); - localStorage.setItem("username", res.data.username); - window.location.href = "index.html"; - } else { - layer.msg(res.msg, {offset: '150px'}); - } - } - }); - return false; + } }); + }); - $('body').keydown(function () { - if (event.keyCode === 13) { - $("#login-button").click(); + $('body').keydown(function () { + if (event.keyCode === 13) { + $(".login-btn").click(); + } + }); + + //鏇存柊璁稿彲璇� + $("#submitLicense").on("click",() => { + $("#license").click() + }) + + //涓婁紶骞舵洿鏂拌鍙瘉 + $("#license").on("change",(evt) => { + var files = evt.target.files; + let formData = new FormData(); + formData.append("file", files[0]) + $.ajax({ + url: baseUrl+"/license/updateLicense", + data: formData, + method: 'POST', + cache: false, + processData: false, + contentType: false, + success: function (res) { + if (res.code == 200) { + layer.msg('鏇存柊鎴愬姛', {time: 1000}, () => { + parent.location.reload() + }); + }else{ + layer.msg(res.msg,{time:2000},() => { + parent.location.reload() + }) } - }); - - }); -</script> -</html> \ No newline at end of file + } + }) + }) + </script> + </body> +</html> -- Gitblit v1.9.1