|
|
@@ -170,12 +170,13 @@ public class SessionUtil { |
|
|
|
//校验指纹 |
|
|
|
String fpKey = us != null ? String.valueOf(us.getUserId()): request.getSession(true).getId(); |
|
|
|
int fpv = readFingerVal(request); |
|
|
|
|
|
|
|
SessionCache cache = SessionCacheFactory.getInstance().getCache(KEY_PARAM_FP_KEY, 1200L); |
|
|
|
AtomicInteger ai = cache.get(fpKey + "_" + fpk); |
|
|
|
int bv = ai != null ? ai.get() : 0; |
|
|
|
if (fpv != bv) { |
|
|
|
throw new BizException(SwConsts.ErrorCode.TOKEN_INVALID, "指纹错误,请勿重复提交!"); |
|
|
|
if (fpv > 0) { |
|
|
|
SessionCache cache = SessionCacheFactory.getInstance().getCache(KEY_PARAM_FP_KEY, 1200L); |
|
|
|
AtomicInteger ai = cache.get(fpKey + "_" + fpk); |
|
|
|
int bv = ai != null ? ai.get(): 0; |
|
|
|
if (fpv != bv) { |
|
|
|
throw new BizException(SwConsts.ErrorCode.TOKEN_INVALID, "指纹错误,请勿重复提交!"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|