From d0554fe871d405268950cd5853755e611ea3a6a6 Mon Sep 17 00:00:00 2001 From: Junjie <fallin.jie@qq.com> Date: 星期二, 28 十一月 2023 08:44:53 +0800 Subject: [PATCH] #许可证 --- src/main/webapp/views/login.html | 56 +++++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 49 insertions(+), 7 deletions(-) diff --git a/src/main/webapp/views/login.html b/src/main/webapp/views/login.html index 40c39b9..aaa7ae5 100644 --- a/src/main/webapp/views/login.html +++ b/src/main/webapp/views/login.html @@ -90,7 +90,7 @@ align-items: center; } - #login-button { + .login-button { position: relative; width: 100%; border: 2px solid #8000ff; @@ -106,7 +106,7 @@ overflow: hidden; } - #login-button::after { + .login-button::after { content: ""; position: absolute; background-color: rgba(255, 255, 255, 0.253); @@ -120,7 +120,7 @@ transition-duration: .5s; } - #login-button:hover::after { + .login-button:hover::after { transform: translateX(600px); transition-duration: .5s; } @@ -209,7 +209,14 @@ <input placeholder="璇疯緭鍏ュ瘑鐮�" id="password" name="pass" class="inputField" type="password"> </div> - <input type="button" id="login-button" value="鐧诲綍"> + <input type="button" id="login-button" class="login-button" value="鐧诲綍"> + + <div style="display: none;margin-top: 5px;width: 100%;" id="updateLicense"> + <form enctype="multipart/form-data" style="display: none;"> + <input id="license" type="file" name="file" > + </form> + <input type="button" id="submitLicense" class="login-button" style="margin: 0;" value="鏇存柊璁稿彲璇�"> + </div> </div> </div> @@ -287,9 +294,12 @@ 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']}); - } + } else if (res.code === 20001) { + layer.tips(res.msg, '#login-button', {tips: [3, '#ff0000']}); + $("#updateLicense").show() + } else { + layer.tips(res.msg, '#login-button', {tips: [3, '#ff0000']}); + } } }); }); @@ -307,6 +317,38 @@ $("#copyright-img1").on("mouseout", () => { $("#copyright-img-large1").hide() }) + + //鏇存柊璁稿彲璇� + $("#submitLicense").on("click",() => { + $("#license").click() + }) + + //涓婁紶骞舵洿鏂拌鍙瘉 + $("#license").on("change",(evt) => { + var files = evt.target.files; + console.log(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> </body> </html> -- Gitblit v1.9.1