|
|
@@ -2,10 +2,12 @@ package com.cec.plugins.config;
|
|
|
|
|
|
import cn.hutool.core.date.DatePattern;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
+import com.cec.plugins.utils.LicenseUtil;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.boot.ApplicationArguments;
|
|
|
import org.springframework.boot.ApplicationRunner;
|
|
|
+import org.springframework.boot.SpringApplication;
|
|
|
import org.springframework.context.ApplicationContext;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
@@ -27,6 +29,13 @@ public class RunnerLog implements ApplicationRunner {
|
|
|
|
|
|
@Override
|
|
|
public void run(ApplicationArguments args) {
|
|
|
+ if (LicenseUtil.licenseExpired()) {
|
|
|
+ log.info("\033[1;33m {} \033[0m", String.format("\n ========== 启动服务 =========="
|
|
|
+ + "\n\t 授权时间已过期,请来及时联系管理员"
|
|
|
+ + "\n\t 授权时间:\t%s"
|
|
|
+ + "\n ============================", LicenseUtil.licenseUntil()));
|
|
|
+ System.exit(SpringApplication.exit(ctx));
|
|
|
+ }
|
|
|
String appJvmName = ManagementFactory.getRuntimeMXBean().getName();
|
|
|
String path = Optional.ofNullable(ctx.getEnvironment().getProperty("server.servlet.context-path")).orElse("");
|
|
|
String httpPort = ctx.getEnvironment().getProperty("server.port");
|