From 28386f9b996c48a338b751da69e3610917b3e1bf Mon Sep 17 00:00:00 2001 From: zainali5120 <512061637@qq.com> Date: Wed, 14 Oct 2020 15:15:47 +0800 Subject: [PATCH] ROC重复提交修复 --- src/main/java/com/xcong/excoin/common/aop/SubmitRepeatAspect.java | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/xcong/excoin/common/aop/SubmitRepeatAspect.java b/src/main/java/com/xcong/excoin/common/aop/SubmitRepeatAspect.java index f033e03..f7f4596 100644 --- a/src/main/java/com/xcong/excoin/common/aop/SubmitRepeatAspect.java +++ b/src/main/java/com/xcong/excoin/common/aop/SubmitRepeatAspect.java @@ -3,6 +3,7 @@ import cn.hutool.core.util.StrUtil; import cn.hutool.crypto.asymmetric.KeyType; import cn.hutool.crypto.asymmetric.RSA; +import com.xcong.excoin.common.LoginUserUtils; import com.xcong.excoin.common.annotations.SubmitRepeat; import com.xcong.excoin.common.contants.AppContants; import com.xcong.excoin.common.response.Result; @@ -51,18 +52,19 @@ ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); HttpServletRequest request = attributes.getRequest(); -// String token = request.getHeader("token"); + //String token = request.getHeader("token"); String bearerToken = request.getHeader(AppContants.TOKEN_HEADER); String rsaToken = bearerToken.replace(AppContants.TOKEN_START_WITH, ""); RSA rsa = new RSA(securityProperties.getPrivateKey(), null); String[] tokens = StrUtil.split(rsa.decryptStr(rsaToken, KeyType.PrivateKey), "_"); String token = tokens[0]; String uri = request.getRequestURI(); - String mId = (String) redisUtil.get(token); - log.debug("#token : {}, uri : {}, mId : {}#", token, uri, mId); + Long mId = LoginUserUtils.getAppLoginUser().getId(); + //String mId = (String) redisUtil.get(token); + log.info("#token : {}, uri : {}, mId : {}#", token, uri, mId); key = mId + "_" + uri; boolean flag = redisUtil.setNotExist(key, "1", 5); - log.debug("#mid : {}, flag : {}#", mId, flag); + log.info("#mid : {}, flag : {}#", mId, flag); if (flag) { Object result = joinPoint.proceed(); redisUtil.del(key); -- Gitblit v1.9.1