|
|
|
@ -72,6 +72,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
|
|
|
|
|
// 获取头中参数
|
|
|
|
|
String authTime = request.getHeader("authTime"); |
|
|
|
|
if (StrUtil.isEmpty(authTime)) { |
|
|
|
|
log.info("##########preHandle: 时间戳不能为空"); |
|
|
|
|
returnJson(response, JSONObject.toJSONString(R.fail(1, "时间戳不能为空"))); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
@ -84,6 +85,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
|
|
|
|
|
if (StringUtil.isNotBlank(authTime)) { |
|
|
|
|
long authTimeLong = Long.parseLong(authTime); |
|
|
|
|
if (secondTimestamp - authTimeLong > suoFeiYaProperties.getAuthTime()) { |
|
|
|
|
log.info("##########preHandle: 时间戳过期"); |
|
|
|
|
returnJson(response, JSONObject.toJSONString(R.fail(1, "认证不通过,时间戳过期"))); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
@ -93,6 +95,7 @@ public class LocalServerLoginAccountsInterceptor extends HandlerInterceptorAdapt
|
|
|
|
|
String md5Hex = MD5.create().digestHex(authTime + auth).toUpperCase(); |
|
|
|
|
log.info("##########preHandle: md5Hex={}", md5Hex); |
|
|
|
|
if (!StrUtil.equals(md5Hex, sign)) { |
|
|
|
|
log.info("##########preHandle: 签名不正确"); |
|
|
|
|
returnJson(response, JSONObject.toJSONString(R.fail(1, "认证不通过,签名不正确"))); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|