|
@@ -1,6 +1,7 @@
|
|
|
package cn.com.qmth.stmms.biz.config.ukey;
|
|
|
|
|
|
import cn.com.qmth.stmms.biz.config.service.impl.SystemCache;
|
|
|
+import cn.com.qmth.stmms.biz.user.service.UserService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
@@ -15,6 +16,9 @@ public class UKeyJob {
|
|
|
@Value("${qmth.ukey.license.id}")
|
|
|
private Long ukeyLicenseId;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private UserService userService;
|
|
|
+
|
|
|
@Scheduled(fixedDelay = 1 * 60 * 1000, initialDelay = 5 * 1000)
|
|
|
public void run() {
|
|
|
try {
|
|
@@ -23,6 +27,7 @@ public class UKeyJob {
|
|
|
UKeyHelper.UKEY_MESSAGE = UKeyHelper.UKEY_STATUS ? "U盾许可认证成功" : "U盾许可认证失败";
|
|
|
if(!UKeyHelper.UKEY_STATUS){
|
|
|
systemCache.reset();
|
|
|
+ userService.logoutAll();
|
|
|
}else{
|
|
|
systemCache.init();
|
|
|
}
|
|
@@ -30,6 +35,7 @@ public class UKeyJob {
|
|
|
UKeyHelper.UKEY_STATUS = false;
|
|
|
UKeyHelper.UKEY_MESSAGE = "U盾许可认证异常";
|
|
|
systemCache.reset();
|
|
|
+ userService.logoutAll();
|
|
|
} finally {
|
|
|
UKeyHelper.slmCleanupEasy();
|
|
|
}
|