|
@@ -1,5 +1,7 @@
|
|
|
package com.ruoyi.framework.config.license;
|
|
|
|
|
|
+import com.global.base.log.LogLevelFlag;
|
|
|
+import com.global.base.log.LogPrintMgr;
|
|
|
import com.global.base.tools.AESUtil;
|
|
|
import com.global.base.tools.FastJsonUtil;
|
|
|
import org.slf4j.Logger;
|
|
@@ -20,7 +22,6 @@ import java.util.Map;
|
|
|
public class GlobalData {
|
|
|
private volatile boolean mBLicenseSwitch = false; //license验证开关,对***.jar所在目录下的license.origin文件进行验证
|
|
|
private Method licenseInit = null, licenseCheck = null, licenseGetKey = null;
|
|
|
- private String licenseOrigin = "";
|
|
|
private volatile boolean mBSwitchTraceLog = true; //是否开启基于TraceId的日志记录
|
|
|
public static final Logger ACCESS_LOG = LoggerFactory.getLogger("sys-access");
|
|
|
private static volatile GlobalData msInstance = null;
|
|
@@ -38,8 +39,6 @@ public class GlobalData {
|
|
|
if (!mBLicenseSwitch)
|
|
|
return;
|
|
|
if (licenseInit == null){
|
|
|
- String[] licenseOriginElements = {System.getProperty("user.dir"), "license.origin"};
|
|
|
- licenseOrigin = CommTool.readFile(String.join(File.separator, licenseOriginElements));
|
|
|
final InputStream licenseIn = this.getClass().getClassLoader().getResourceAsStream("BOOT-INF/license/LicenseMgr.res");
|
|
|
try {
|
|
|
Class licenseClass = new MyClassLoader(licenseIn).loadClass("com.global.base.licensemgr.LicenseMgr");
|
|
@@ -60,6 +59,8 @@ public class GlobalData {
|
|
|
|
|
|
if (licenseInit != null){
|
|
|
try {
|
|
|
+ String[] licenseOriginElements = {System.getProperty("user.dir"), "license.origin"};
|
|
|
+ final String licenseOrigin = CommTool.readFile(String.join(File.separator, licenseOriginElements));
|
|
|
Map<String, String> licenseObj = null;
|
|
|
if (licenseGetKey != null){
|
|
|
String tmp = AESUtil.AESDecrypt(AESUtil.Mode.CBC, AESUtil.Padding.PKCS5_PADDING, (String)licenseGetKey.invoke(null), licenseOrigin);
|
|
@@ -70,7 +71,7 @@ public class GlobalData {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
- ACCESS_LOG.info(String.format("License Check Result {%s}", checkLicense()?"True":"False"));
|
|
|
+ ACCESS_LOG.info(String.format("License Check Result {%s}", checkLicense()?"True":"False"));
|
|
|
}
|
|
|
}
|
|
|
|