Commit 8dbd59b5 authored by Smile's avatar Smile

fix:重复请求时,返回对应的多语言提示内容

parent 92aba2ff
...@@ -2,6 +2,7 @@ package cn.iocoder.yudao.framework.idempotent.core.aop; ...@@ -2,6 +2,7 @@ package cn.iocoder.yudao.framework.idempotent.core.aop;
import cn.iocoder.yudao.framework.common.exception.ServiceException; import cn.iocoder.yudao.framework.common.exception.ServiceException;
import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants;
import cn.iocoder.yudao.framework.i18n.core.I18nMessage;
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent; import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import cn.iocoder.yudao.framework.idempotent.core.keyresolver.IdempotentKeyResolver; import cn.iocoder.yudao.framework.idempotent.core.keyresolver.IdempotentKeyResolver;
import cn.iocoder.yudao.framework.idempotent.core.redis.IdempotentRedisDAO; import cn.iocoder.yudao.framework.idempotent.core.redis.IdempotentRedisDAO;
...@@ -49,7 +50,7 @@ public class IdempotentAspect { ...@@ -49,7 +50,7 @@ public class IdempotentAspect {
// 锁定失败,抛出异常 // 锁定失败,抛出异常
if (!success) { if (!success) {
log.info("[beforePointCut][方法({}) 参数({}) 存在重复请求]", joinPoint.getSignature().toString(), joinPoint.getArgs()); log.info("[beforePointCut][方法({}) 参数({}) 存在重复请求]", joinPoint.getSignature().toString(), joinPoint.getArgs());
throw new ServiceException(GlobalErrorCodeConstants.REPEATED_REQUESTS.getCode(), idempotent.message()); throw new ServiceException(GlobalErrorCodeConstants.REPEATED_REQUESTS.getCode(), I18nMessage.getMessage(GlobalErrorCodeConstants.REPEATED_REQUESTS.getMsg()));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment