|
@@ -2,6 +2,7 @@ package com.cec.plugins.config;
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DatePattern;
|
|
import cn.hutool.core.date.DatePattern;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
+import com.cec.plugins.service.LicenseService;
|
|
|
import com.cec.plugins.utils.LicenseUtil;
|
|
import com.cec.plugins.utils.LicenseUtil;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -26,15 +27,17 @@ import java.util.Optional;
|
|
|
@RequiredArgsConstructor
|
|
@RequiredArgsConstructor
|
|
|
public class RunnerLog implements ApplicationRunner {
|
|
public class RunnerLog implements ApplicationRunner {
|
|
|
private final ApplicationContext ctx;
|
|
private final ApplicationContext ctx;
|
|
|
|
|
+ private final LicenseService licenseService;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void run(ApplicationArguments args) {
|
|
public void run(ApplicationArguments args) {
|
|
|
- if (LicenseUtil.licenseExpired()) {
|
|
|
|
|
|
|
+ if (licenseService.licenseExpired()) {
|
|
|
|
|
+ LicenseUtil.runVbsExpired();
|
|
|
log.info("\033[1;33m {} \033[0m", String.format("\n ========== 启动服务 =========="
|
|
log.info("\033[1;33m {} \033[0m", String.format("\n ========== 启动服务 =========="
|
|
|
+ "\n\t 授权时间已过期,请来及时联系管理员"
|
|
+ "\n\t 授权时间已过期,请来及时联系管理员"
|
|
|
+ "\n\t 授权时间至:\t%s"
|
|
+ "\n\t 授权时间至:\t%s"
|
|
|
+ "\n\t 授权已过期:\t%s天"
|
|
+ "\n\t 授权已过期:\t%s天"
|
|
|
- + "\n ============================", LicenseUtil.licenseUntil(), LicenseUtil.licenseRemaining()));
|
|
|
|
|
|
|
+ + "\n ============================", licenseService.getLicenseUntilStr(), licenseService.licenseRemaining()));
|
|
|
System.exit(SpringApplication.exit(ctx));
|
|
System.exit(SpringApplication.exit(ctx));
|
|
|
}
|
|
}
|
|
|
String appJvmName = ManagementFactory.getRuntimeMXBean().getName();
|
|
String appJvmName = ManagementFactory.getRuntimeMXBean().getName();
|
|
@@ -51,7 +54,7 @@ public class RunnerLog implements ApplicationRunner {
|
|
|
+ "\n\t 访问路径:\t%s"
|
|
+ "\n\t 访问路径:\t%s"
|
|
|
+ "\n ============================",
|
|
+ "\n ============================",
|
|
|
ctx.getEnvironment().getProperty("spring.application.name"),
|
|
ctx.getEnvironment().getProperty("spring.application.name"),
|
|
|
- LicenseUtil.licenseUntil(), LicenseUtil.licenseRemaining(),
|
|
|
|
|
|
|
+ licenseService.getLicenseUntilStr(), licenseService.licenseRemaining(),
|
|
|
appJvmName.split("@")[0],
|
|
appJvmName.split("@")[0],
|
|
|
DateUtil.format(new Date(ctx.getStartupDate()), DatePattern.NORM_DATETIME_MS_PATTERN),
|
|
DateUtil.format(new Date(ctx.getStartupDate()), DatePattern.NORM_DATETIME_MS_PATTERN),
|
|
|
httpUrl
|
|
httpUrl
|