From c60ff5a68d23853978a5f53c36867c6a2195ceca Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期六, 07 六月 2025 09:38:11 +0800
Subject: [PATCH] *

---
 src/main/java/com/zy/asrs/controller/ConsoleController.java |   33 ++++++++++++++++++---------------
 src/main/webapp/views/index.html                            |   12 +++++++-----
 src/main/java/com/zy/core/ServerBootstrap.java              |    6 +++++-
 3 files changed, 30 insertions(+), 21 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/ConsoleController.java b/src/main/java/com/zy/asrs/controller/ConsoleController.java
index f4e6b38..7526faa 100644
--- a/src/main/java/com/zy/asrs/controller/ConsoleController.java
+++ b/src/main/java/com/zy/asrs/controller/ConsoleController.java
@@ -58,23 +58,26 @@
     @PostMapping("/system/switch")
 //    @ManagerAuth(memo = "绯荤粺杩愯寮�鍏虫搷浣�")
     public R systemSwitch(SystemSwitchParam param) throws InterruptedException {
-        if (Cools.isEmpty(param.getOperatorType())){
-            return R.error();
-        }
-        if (param.getOperatorType() == 0) {
-            if (Cools.isEmpty(param.getPassword())){
-                return R.error("璇疯緭鍏ュ彛浠�");
-            }
-            if (!param.getPassword().equals(SystemProperties.WCS_PASSWORD)){
-                return R.error("鍙d护閿欒");
-            }
-        }
-        Thread.sleep(200L);
+//        if (Cools.isEmpty(param.getOperatorType())){
+//            return R.error();
+//        }
+//        if (param.getOperatorType() == 0) {
+//            if (Cools.isEmpty(param.getPassword())){
+//                return R.error("璇疯緭鍏ュ彛浠�");
+//            }
+//            if (!param.getPassword().equals(SystemProperties.WCS_PASSWORD)){
+//                return R.error("鍙d护閿欒");
+//            }
+//        }
+//        Thread.sleep(200L);
         //楠岃瘉璁稿彲璇佹槸鍚︽湁鏁�
         try{
-            if (new LicenseVerify().verify()){
-                SystemProperties.WCS_RUNNING_STATUS.set(param.getOperatorType()==1?Boolean.TRUE:Boolean.FALSE);
-                return R.ok().add(Cools.add("status", SystemProperties.WCS_RUNNING_STATUS.get()));
+            boolean systemSign = SystemProperties.WCS_RUNNING_STATUS.get();
+            if (!systemSign){
+                if (new LicenseVerify().verify()){
+                    SystemProperties.WCS_RUNNING_STATUS.set(Boolean.TRUE);
+                    return R.ok().add(Cools.add("status", SystemProperties.WCS_RUNNING_STATUS.get()));
+                }
             }
         } catch (Exception e){
             log.error("璁稿彲璇侀獙璇佸け璐ワ紒锛佸紓甯革細{}",e.getMessage());
diff --git a/src/main/java/com/zy/core/ServerBootstrap.java b/src/main/java/com/zy/core/ServerBootstrap.java
index 54bfe7d..28352cb 100644
--- a/src/main/java/com/zy/core/ServerBootstrap.java
+++ b/src/main/java/com/zy/core/ServerBootstrap.java
@@ -139,6 +139,7 @@
         public void licenseVerify() {
             int licenseVerifySignCount = 0;
             boolean licenseVerifySign = false;
+            boolean systemSign = SystemProperties.WCS_RUNNING_STATUS.get();
             if (!new LicenseVerify().verify()){
                 for (licenseVerifySignCount = 0;!licenseVerifySign && licenseVerifySignCount<10; licenseVerifySignCount++){
                     try{
@@ -155,9 +156,12 @@
                 }
                 if (licenseVerifySignCount>10 && !licenseVerifySign){
                     SystemProperties.WCS_RUNNING_STATUS.set(Boolean.FALSE);
+                } else {
+                    if (systemSign){
+                        SystemProperties.WCS_RUNNING_STATUS.set(Boolean.TRUE);
+                    }
                 }
             }
         }
     }
-
 }
diff --git a/src/main/webapp/views/index.html b/src/main/webapp/views/index.html
index 088a6f8..b2aeede 100644
--- a/src/main/webapp/views/index.html
+++ b/src/main/webapp/views/index.html
@@ -724,7 +724,9 @@
                             }
                         }
                     });
-
+                    // setTimeout(function() {
+                    //
+                    // }, 1000);
                 },
                 getValueSystem() {
                     let that = this;
@@ -744,11 +746,11 @@
                 },
                 upDateValueSystem(){
                     let that = this;
+                    let operatorTypeI = 0;
+                    if (that.valueSystem){
+                        operatorTypeI = 1;
+                    }
                     this.verifyPassword(() => {
-                        let operatorTypeI = 0;
-                        if (that.valueSystem){
-                            operatorTypeI = 1;
-                        }
                         $.ajax({
                             url: baseUrl + "/console/system/switch",
                             headers: {'token': localStorage.getItem('token')},

--
Gitblit v1.9.1