yin 6 months ago
parent
commit
f7cdd4da69

+ 5 - 3
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/config/ukey/UKeyHelper.java

@@ -19,11 +19,13 @@ public class UKeyHelper {
 
 
     public static String UKEY_MESSAGE = "U盾环境正在初始化";
     public static String UKEY_MESSAGE = "U盾环境正在初始化";
 
 
+    public static String UKEY_API_PASSWORD = "3266297f8519bc7e8107ac0871dd4915";
+
     /**
     /**
      * U盾环境初始化
      * U盾环境初始化
      */
      */
-    public static void slmInitEasy(String apiPsd) throws Exception {
-        long result = SSRuntimeEasy.SlmInitEasy(apiPsd);
+    public static void slmInitEasy() throws Exception {
+        long result = SSRuntimeEasy.SlmInitEasy(UKEY_API_PASSWORD);
         if (result != ErrorCode.SS_OK) {
         if (result != ErrorCode.SS_OK) {
             SSRuntimeEasy.SlmErrorFormatEasy(result, Language);
             SSRuntimeEasy.SlmErrorFormatEasy(result, Language);
             // log.warn("SlmInitEasy Fail! {}", msg);
             // log.warn("SlmInitEasy Fail! {}", msg);
@@ -155,7 +157,7 @@ public class UKeyHelper {
             // System.setProperty("java.library.path",
             // System.setProperty("java.library.path",
             // "/Users/yin/Desktop/API/mac/Java/lib64/libSSRuntimeEasyJava.dylib");
             // "/Users/yin/Desktop/API/mac/Java/lib64/libSSRuntimeEasyJava.dylib");
 
 
-            UKeyHelper.slmInitEasy("3266297f8519bc7e8107ac0871dd4915");
+            UKeyHelper.slmInitEasy();
 
 
             System.out.println(UKeyHelper.verifyUKey(100000003L));
             System.out.println(UKeyHelper.verifyUKey(100000003L));
         } finally {
         } finally {

+ 1 - 4
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/config/ukey/UKeyJob.java

@@ -12,16 +12,13 @@ public class UKeyJob {
 	@Autowired
 	@Autowired
 	private SystemCache systemCache;
 	private SystemCache systemCache;
 
 
-	@Value("${qmth.ukey.api.psd}")
-	private String ukeyApiPsd;
-
 	@Value("${qmth.ukey.license.id}")
 	@Value("${qmth.ukey.license.id}")
 	private Long ukeyLicenseId;
 	private Long ukeyLicenseId;
 
 
 	@Scheduled(fixedDelay = 1 * 1000, initialDelay = 5 * 1000)
 	@Scheduled(fixedDelay = 1 * 1000, initialDelay = 5 * 1000)
 	public void run() {
 	public void run() {
 		try {
 		try {
-			UKeyHelper.slmInitEasy(ukeyApiPsd);
+			UKeyHelper.slmInitEasy();
 			UKeyHelper.UKEY_STATUS = UKeyHelper.verifyUKey(ukeyLicenseId);
 			UKeyHelper.UKEY_STATUS = UKeyHelper.verifyUKey(ukeyLicenseId);
 			UKeyHelper.UKEY_MESSAGE = UKeyHelper.UKEY_STATUS ? "U盾许可认证成功" : "U盾许可认证失败";
 			UKeyHelper.UKEY_MESSAGE = UKeyHelper.UKEY_STATUS ? "U盾许可认证成功" : "U盾许可认证失败";
 			if(!UKeyHelper.UKEY_STATUS){
 			if(!UKeyHelper.UKEY_STATUS){

+ 2 - 1
stmms-web/src/main/webapp/WEB-INF/application.properties

@@ -43,4 +43,5 @@ qmth.examcloud.student.uri=/api/exchange/outer/question/getSubjectiveQuestion
 school.updateMinute=0 0 0 * * ?
 school.updateMinute=0 0 0 * * ?
 qmth.solar.host=https://solar.qmth.com.cn
 qmth.solar.host=https://solar.qmth.com.cn
 qmth.solar.org.uri=/api/open/org/query
 qmth.solar.org.uri=/api/open/org/query
-qmth.solar.app.uri=/api/open/app/info
+qmth.solar.app.uri=/api/open/app/info
+qmth.ukey.license.id=100000003