Browse Source

circle

release_toaliyun_real
xhxu 5 years ago
parent
commit
965875beb2
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      mallinkPublicApi/src/main/java/com/iformall/interceptor/AuthorizationInterceptor.java

+ 4
- 2
mallinkPublicApi/src/main/java/com/iformall/interceptor/AuthorizationInterceptor.java View File

@@ -88,19 +88,21 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
} }


logger.info("sign={}"+signature); logger.info("sign={}"+signature);
String signKey = apiConfig.getSignKey();
for (String key:notKeys) { for (String key:notKeys) {
if(parameterMap.containsKey(key)){ if(parameterMap.containsKey(key)){
parameterMap.remove(key); parameterMap.remove(key);
} }
} }
logger.info("parameterMap={}"+parameterMap.toString());


String newSignature = SignUtils.getSign(signKey, parameterMap, "MD5");
String newSignature = SignUtils.getSign(apiConfig.getSignKey(), parameterMap, "MD5");
//加密串不匹配 //加密串不匹配
if (!signature.equals(newSignature)) { if (!signature.equals(newSignature)) {
throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"加密串校验失败"); throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"加密串校验失败");
} }
Integer cache = RedisCacheUtils.getCacheInteger(redisTemplate, Constant.publicApiNonce+signature); Integer cache = RedisCacheUtils.getCacheInteger(redisTemplate, Constant.publicApiNonce+signature);
logger.info("cache={}"+cache.toString());
if (null != cache) { if (null != cache) {
throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"重复调用"); throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"重复调用");
} }


Loading…
Cancel
Save