| @@ -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(),"重复调用"); | ||||
| } | } | ||||