Commit 69f0afd7 authored by wux's avatar wux

bug299:处理重复提交的问题

parent 8a48f546
package cn.iocoder.yudao.module.ecw.controller.admin.messageLeave;
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
import org.springframework.web.bind.annotation.*;
......@@ -38,6 +39,7 @@ public class MessageLeaveController {
@PostMapping("/create")
@ApiOperation("创建留言")
@Idempotent(timeout = 5)
//@PreAuthorize("@ss.hasPermission('ecw:message-leave:create')")
@PreAuthenticated
public CommonResult<Long> createMessageLeave(@Valid @RequestBody MessageLeaveCreateReqVO createReqVO) {
......
......@@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.ecw.controller.app.messageLeave;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.util.ExcelUtils;
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
......@@ -37,6 +38,7 @@ public class AppMessageLeaveController {
@PostMapping("/create")
@ApiOperation("创建留言")
@Idempotent(timeout = 5)
//@PreAuthorize("@ss.hasPermission('ecw:message-leave:create')")
@PreAuthenticated
public CommonResult<Long> createMessageLeave(@Valid @RequestBody MessageLeaveCreateReqVO createReqVO) {
......
......@@ -52,7 +52,7 @@ public class AppAuthController {
@PostMapping("/reg")
@ApiOperation("使用手机注册")
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
@Idempotent(timeout = 5)
@Idempotent(timeout = 10)
public CommonResult<AppAuthLoginRespVO> reg(@RequestBody @Valid AppAuthRegReqVO reqVO) {
String mobileCode = reqVO.getAreaCode() + StrUtil.COLON + reqVO.getMobile();
paramValidatorApi.validatorMobile(mobileCode);
......
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