From a881d98d2eee345af7454fd943fccbcc5c8bcb6f Mon Sep 17 00:00:00 2001
From: tzsk <Administrator@qq.com>
Date: 星期一, 04 八月 2025 15:01:40 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/system/entity/license/LicenseVerify.java | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/zy/system/entity/license/LicenseVerify.java b/src/main/java/com/zy/system/entity/license/LicenseVerify.java
index 2175930..597648a 100644
--- a/src/main/java/com/zy/system/entity/license/LicenseVerify.java
+++ b/src/main/java/com/zy/system/entity/license/LicenseVerify.java
@@ -3,8 +3,11 @@
import de.schlichtherle.license.*;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+import org.apache.poi.util.IOUtils;
import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
import java.text.DateFormat;
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
@@ -28,7 +31,12 @@
LicenseManager licenseManager = LicenseManagerHolder.getInstance(initLicenseParam(param));
licenseManager.uninstall();
- result = licenseManager.install(new File(param.getLicensePath()));
+ InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(param.getLicensePath());
+ File file = new File(param.getLicensePath());
+ try (FileOutputStream out = new FileOutputStream(file)) {
+ IOUtils.copy(inputStream, out);
+ }
+ result = licenseManager.install(file);
logger.info(MessageFormat.format("璁稿彲璇佸姞杞芥垚鍔燂紝璁稿彲璇佹湁鏁堟湡锛歿0} - {1}",format.format(result.getNotBefore()),format.format(result.getNotAfter())));
}catch (Exception e){
logger.error("璁稿彲璇佸姞杞藉け璐ワ紒",e);
--
Gitblit v1.9.1