#
Junjie
2026-01-15 a2eb2511f620956dbb5d36742f1d0ffda034f090
src/main/java/com/zy/system/timer/LicenseTimer.java
@@ -18,9 +18,9 @@
@Component
public class LicenseTimer {
    private static boolean SYSTEM_SUPPORT = false;//系统激活状态,默认关闭
    private static boolean SYSTEM_SUPPORT = false;// 系统激活状态,默认关闭
    private static int LICENSE_DAYS = 0;//许可证天数
    private static int LICENSE_DAYS = 0;// 许可证天数
    /**
     * 证书subject
@@ -55,7 +55,7 @@
    @Autowired
    private LicenseInfosService licenseInfosService;
    //每天晚上11点更新系统激活状态
    // 每天晚上11点更新系统激活状态
    @Scheduled(cron = "0 0 23 * * ? ")
    public void timer() {
        try {
@@ -75,12 +75,12 @@
        try {
            AbstractServerInfos abstractServerInfos = null;
            String osName = System.getProperty("os.name");
            //根据不同操作系统类型选择不同的数据获取方法
            // 根据不同操作系统类型选择不同的数据获取方法
            if (osName.startsWith("windows")) {
                abstractServerInfos = new WindowsServerInfos();
            } else if (osName.startsWith("linux")) {
                abstractServerInfos = new LinuxServerInfos();
            }else{//其他服务器类型
            } else {// 其他服务器类型
                abstractServerInfos = new WindowsServerInfos();
            }
            LicenseCheck serverInfos = abstractServerInfos.getServerInfos();
@@ -123,9 +123,9 @@
        param.setLicensePath(licensePath);
        param.setPublicKeysStorePath(publicKeysStorePath);
        //验证许可证是否有效
        // 验证许可证是否有效
        LicenseVerify licenseVerify = new LicenseVerify();
        //安装证书
        // 安装证书
        LicenseContent install = licenseVerify.install(param, latestLicense.getLicense());
        if (install != null) {
@@ -133,11 +133,11 @@
            Date end = install.getNotAfter();
            Long starTime = start.getTime();
            Long endTime = end.getTime();
            long num = endTime - starTime;//时间戳相差的毫秒数
            long num = endTime - starTime;// 时间戳相差的毫秒数
            int day = (int) (num / 24 / 60 / 60 / 1000);
            setLicenseDays(day);
            setSystemSupport(true);
        }else {
        } else {
            setLicenseDays(0);
            setSystemSupport(false);
        }