diff --git a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/keyresolver/impl/DefaultIdempotentKeyResolver.java b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/keyresolver/impl/DefaultIdempotentKeyResolver.java
index 56856993..60b35cc2 100644
--- a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/keyresolver/impl/DefaultIdempotentKeyResolver.java
+++ b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/core/keyresolver/impl/DefaultIdempotentKeyResolver.java
@@ -2,6 +2,7 @@ package cn.iocoder.yudao.framework.idempotent.core.keyresolver.impl;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
+import cn.hutool.json.JSONUtil;
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import cn.iocoder.yudao.framework.idempotent.core.keyresolver.IdempotentKeyResolver;
import org.aspectj.lang.JoinPoint;
@@ -18,7 +19,7 @@ public class DefaultIdempotentKeyResolver implements IdempotentKeyResolver {
@Override
public String resolver(JoinPoint joinPoint, Idempotent idempotent) {
String methodName = joinPoint.getSignature().toString();
- String argsStr = StrUtil.join(",", joinPoint.getArgs());
+ String argsStr = StrUtil.join(",", JSONUtil.toJsonStr(joinPoint.getArgs()));
return SecureUtil.md5(methodName + argsStr);
}
diff --git a/zsw-bxg/pom.xml b/zsw-bxg/pom.xml
index 1a0d6e2d..dd57a6d5 100644
--- a/zsw-bxg/pom.xml
+++ b/zsw-bxg/pom.xml
@@ -207,6 +207,10 @@
jsoup
1.14.2
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-protection
+
diff --git a/zsw-bxg/src/main/java/co/yixiang/app/common/bean/LocalUser.java b/zsw-bxg/src/main/java/co/yixiang/app/common/bean/LocalUser.java
index 2cccd6b4..b1906377 100644
--- a/zsw-bxg/src/main/java/co/yixiang/app/common/bean/LocalUser.java
+++ b/zsw-bxg/src/main/java/co/yixiang/app/common/bean/LocalUser.java
@@ -10,7 +10,7 @@ package co.yixiang.app.common.bean;
import cn.iocoder.yudao.framework.common.exception.ApiCode;
-import co.yixiang.api.UnAuthenticatedException;
+import co.yixiang.exception.UnAuthenticatedException;
import co.yixiang.app.common.util.JwtToken;
import co.yixiang.app.common.util.RequestUtils;
import co.yixiang.modules.user.domain.YxUser;
diff --git a/zsw-bxg/src/main/java/co/yixiang/app/common/interceptor/PermissionInterceptor.java b/zsw-bxg/src/main/java/co/yixiang/app/common/interceptor/PermissionInterceptor.java
index 41b6fc90..c6074a9f 100644
--- a/zsw-bxg/src/main/java/co/yixiang/app/common/interceptor/PermissionInterceptor.java
+++ b/zsw-bxg/src/main/java/co/yixiang/app/common/interceptor/PermissionInterceptor.java
@@ -12,13 +12,11 @@ package co.yixiang.app.common.interceptor;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.security.core.annotations.AuthCheck;
import cn.iocoder.yudao.framework.common.exception.ApiCode;
-import co.yixiang.api.UnAuthenticatedException;
+import co.yixiang.exception.UnAuthenticatedException;
import co.yixiang.app.common.bean.LocalUser;
import co.yixiang.app.common.util.JwtToken;
-import co.yixiang.constant.ShopConstants;
import co.yixiang.modules.user.domain.YxUser;
import co.yixiang.modules.user.service.YxUserService;
-import co.yixiang.utils.RedisUtils;
import com.auth0.jwt.interfaces.Claim;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@@ -26,7 +24,6 @@ import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
-import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/activity/rest/AppStoreBargainController.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/activity/rest/AppStoreBargainController.java
index 69260379..1c2ffab3 100644
--- a/zsw-bxg/src/main/java/co/yixiang/app/modules/activity/rest/AppStoreBargainController.java
+++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/activity/rest/AppStoreBargainController.java
@@ -13,6 +13,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import cn.iocoder.yudao.framework.common.exception.ShopException;
+import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import co.yixiang.app.common.aop.NoRepeatSubmit;
import co.yixiang.app.common.bean.LocalUser;
import co.yixiang.app.modules.activity.param.BargainShareParam;
@@ -158,7 +159,7 @@ public class AppStoreBargainController {
* 参与砍价
*/
@AppLog(value = "参与砍价", type = 1)
- @NoRepeatSubmit
+ @Idempotent
@AuthCheck
@PostMapping("/bargain/start")
@ApiOperation(value = "参与砍价",notes = "参与砍价")
@@ -176,7 +177,7 @@ public class AppStoreBargainController {
* 帮助好友砍价
*/
@AppLog(value = "帮助好友砍价", type = 1)
- @NoRepeatSubmit
+ @Idempotent
@AuthCheck
@PostMapping("/bargain/help")
@ApiOperation(value = "帮助好友砍价",notes = "帮助好友砍价")
diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/cart/rest/StoreCartController.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/cart/rest/StoreCartController.java
index 025dcc61..e34415d7 100644
--- a/zsw-bxg/src/main/java/co/yixiang/app/modules/cart/rest/StoreCartController.java
+++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/cart/rest/StoreCartController.java
@@ -8,6 +8,7 @@
*/
package co.yixiang.app.modules.cart.rest;
+import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import co.yixiang.annotation.Limit;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import co.yixiang.app.common.aop.NoRepeatSubmit;
@@ -66,7 +67,7 @@ public class StoreCartController {
* 购物车 添加
*/
@AppLog(value = "购物车 添加", type = 1)
- @NoRepeatSubmit
+ @Idempotent
@AuthCheck
@PostMapping("/cart/add")
@ApiOperation(value = "添加购物车",notes = "添加购物车")
@@ -110,7 +111,7 @@ public class StoreCartController {
* 购物车删除产品
*/
@AppLog(value = "购物车删除产品", type = 1)
- @NoRepeatSubmit
+ @Idempotent
@AuthCheck
@PostMapping("/cart/del")
@ApiOperation(value = "购物车删除产品",notes = "购物车删除产品")
diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/rest/CouponController.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/rest/CouponController.java
index 10b1b741..aad345d3 100644
--- a/zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/rest/CouponController.java
+++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/coupon/rest/CouponController.java
@@ -12,6 +12,7 @@ import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import cn.iocoder.yudao.framework.common.exception.ShopException;
+import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import co.yixiang.logging.aop.log.AppLog;
import co.yixiang.app.common.aop.NoRepeatSubmit;
import co.yixiang.app.common.bean.LocalUser;
@@ -93,7 +94,7 @@ public class CouponController {
* 领取优惠券
*/
@AppLog(value = "领取优惠券", type = 1)
- @NoRepeatSubmit
+ @Idempotent
@AuthCheck
@PostMapping("/coupon/receive")
@ApiOperation(value = "领取优惠券",notes = "领取优惠券")
diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/evaluation/rest/AppStoreEvaluationController.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/evaluation/rest/AppStoreEvaluationController.java
index 94241971..d5d145a8 100644
--- a/zsw-bxg/src/main/java/co/yixiang/app/modules/evaluation/rest/AppStoreEvaluationController.java
+++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/evaluation/rest/AppStoreEvaluationController.java
@@ -11,6 +11,7 @@ package co.yixiang.app.modules.evaluation.rest;
import cn.hutool.core.util.NumberUtil;
import cn.iocoder.yudao.framework.common.exception.ShopException;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
+import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import cn.iocoder.yudao.framework.security.core.annotations.AuthCheck;
import co.yixiang.annotation.AnonymousAccess;
import co.yixiang.app.common.aop.NoRepeatSubmit;
@@ -73,7 +74,7 @@ public class AppStoreEvaluationController {
* 添加收藏
*/
@AppLog(value = "添加收藏", type = 1)
- @NoRepeatSubmit
+ @Idempotent
@AuthCheck
@PostMapping("/collectEvaluation/add")
@ApiOperation(value = "添加收藏",notes = "添加收藏")
@@ -90,7 +91,7 @@ public class AppStoreEvaluationController {
* 取消收藏
*/
@AppLog(value = "取消收藏", type = 1)
- @NoRepeatSubmit
+ @Idempotent
@AuthCheck
@PostMapping("/collectEvaluation/del")
@ApiOperation(value = "取消收藏",notes = "取消收藏")
diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/order/rest/AppStoreOrderController.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/order/rest/AppStoreOrderController.java
index ed260885..da4782b9 100644
--- a/zsw-bxg/src/main/java/co/yixiang/app/modules/order/rest/AppStoreOrderController.java
+++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/order/rest/AppStoreOrderController.java
@@ -13,6 +13,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
import cn.iocoder.yudao.framework.common.exception.ShopException;
+import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import co.yixiang.app.common.aop.NoRepeatSubmit;
import co.yixiang.app.common.bean.LocalUser;
import co.yixiang.app.modules.order.param.*;
@@ -133,7 +134,7 @@ public class AppStoreOrderController {
*/
@AppLog(value = "订单创建", type = 1)
@AuthCheck
- @NoRepeatSubmit
+ @Idempotent
@PostMapping("/order/create/{key}")
@ApiOperation(value = "订单创建", notes = "订单创建")
public ApiResult