Commit f40085c8 authored by yanzg's avatar yanzg

身份证识别

parent 362ea410
package com.yanzuoguang.cloud.aop;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
/**
* 是否开启调试
*
* @author 颜佐光
*/
@Component
public class DebugConfig {
/**
* 调试模式
*/
@Value("${yzg.debug:false}")
private boolean debug;
/**
* 调试模式
*/
@Value("${yzg.debugLog:false}")
private boolean debugLog;
/**
* 缓存
*/
@Value("${yzg.cache:true}")
private boolean cache;
public boolean isDebug() {
return debug;
}
public void setDebug(boolean debug) {
this.debug = debug;
}
public boolean isDebugLog() {
return debugLog;
}
public void setDebugLog(boolean debugLog) {
this.debugLog = debugLog;
}
public boolean isCache() {
return cache;
}
public void setCache(boolean cache) {
this.cache = cache;
}
}
......@@ -72,9 +72,7 @@ public class TokenHelper {
boolean isExpire = cacheTokenData.getExpire() < System.currentTimeMillis();
boolean isToken = !StringHelper.isEmpty(cacheTokenData.getToken()) && (isEmpty || isExpire);
if (isToken) {
Log.info(TokenHelper.class, "开始从数据库获取");
TokenData databaseToken = tokenLoad.load(cacheTokenData.getToken());
Log.info(TokenHelper.class, "从数据库获取成功");
if (databaseToken == null || databaseToken.getData() == null) {
return null;
} else {
......@@ -130,9 +128,7 @@ public class TokenHelper {
return (T) tokenData.getData();
} else {
String json = JsonHelper.serialize(tokenData.getData());
Log.info(TokenHelper.class, "序列化字符串");
T result = JsonHelper.deserialize(json, cls);
Log.info(TokenHelper.class, "反序列化结果");
return result;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment