瀏覽代碼

计算激活时间

lyhzzz 2 年之前
父節點
當前提交
5730d495bc

+ 3 - 0
src/main/java/com/fdkankan/ucenter/UserCenterApplication.java

@@ -26,6 +26,8 @@ public class UserCenterApplication implements CommandLineRunner {
     private String uploadType;
     @Value("${main.url}")
     private String mainUrl;
+    @Value("${logging.path}")
+    private String logPath;
 
     public static void main(String[] args) {
         SpringApplication.run(UserCenterApplication.class, args);
@@ -35,6 +37,7 @@ public class UserCenterApplication implements CommandLineRunner {
     public void run(String... args) throws Exception {
         NacosProperty.bucket = bucket;
         NacosProperty.uploadType = uploadType;
+        NacosProperty.logPath = logPath;
         NacosProperty.setMainUrl(mainUrl);
     }
 }

+ 1 - 0
src/main/java/com/fdkankan/ucenter/common/constants/NacosProperty.java

@@ -9,6 +9,7 @@ public class NacosProperty {
 
     public static String bucket;
     public static String uploadType;
+    public static String logPath;
     private static String mainUrl;
 
     public static String getMainUrl() {

+ 3 - 2
src/main/java/com/fdkankan/ucenter/common/utils/AuthLicenseUtil.java

@@ -6,6 +6,7 @@ import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
 import cn.hutool.json.XML;
 import com.fdkankan.common.util.FileUtils;
+import com.fdkankan.ucenter.common.constants.NacosProperty;
 import com.fdkankan.ucenter.util.DateUserUtil;
 import com.fdkankan.ucenter.vo.response.AuthLicenseEntityVo;
 import lombok.extern.slf4j.Slf4j;
@@ -23,8 +24,8 @@ import java.util.Date;
 public class AuthLicenseUtil {
 
     //    Launcher.bat @inPath";
-     static String  cmd ="sudo bash /home/ubuntu/bin/Launcher.sh %s";
-     static String licensePath = "/home/backend/4dkankan_v4/ucenter/license";
+     static String cmd ="sudo bash /home/ubuntu/bin/Launcher.sh %s";
+     static String licensePath = NacosProperty.logPath + "/ucenter/license";
 
      public static JSONObject readLicense(){
          try {