*
lsh
2025-06-07 c60ff5a68d23853978a5f53c36867c6a2195ceca
*
3个文件已修改
51 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/ConsoleController.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/ServerBootstrap.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/index.html 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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("口令错误");
            }
        }
        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("口令错误");
//            }
//        }
//        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());
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);
                    }
                }
            }
        }
    }
}
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')},