From d3bf3d3917d8201d64e8e2c66e99afb7099487f9 Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期四, 23 十月 2025 17:01:23 +0800
Subject: [PATCH] 13

---
 src/main/webapp/views/login.html |   44 +++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 43 insertions(+), 1 deletions(-)

diff --git a/src/main/webapp/views/login.html b/src/main/webapp/views/login.html
index 1cbd22c..1c6ecbb 100644
--- a/src/main/webapp/views/login.html
+++ b/src/main/webapp/views/login.html
@@ -61,7 +61,7 @@
         </p>
         <p class="p-sketch-outline__description">wms made with various simple objects.</p>
       </div>
-      <canvas class="p-canvas-webgl" id="canvas-webgl"></canvas>
+<!--      <canvas class="p-canvas-webgl" id="canvas-webgl"></canvas>-->
     </div>
     <!-- 渚ц竟鏍� -->
     <div id="sidebar">
@@ -86,6 +86,12 @@
           </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>
@@ -140,6 +146,9 @@
               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']});
             }
@@ -152,6 +161,39 @@
           $(".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",
+          headers: {'token': localStorage.getItem('token')},
+          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