From 328298971cc34e247757b01ffaf09451f27a1436 Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Mon, 30 Dec 2024 23:52:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=AE=9D=E6=AC=A1=E6=95=B0?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sqx/modules/app/controller/app/AppController.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/sqx/modules/app/controller/app/AppController.java b/src/main/java/com/sqx/modules/app/controller/app/AppController.java index c55a5cb6..323ffebc 100644 --- a/src/main/java/com/sqx/modules/app/controller/app/AppController.java +++ b/src/main/java/com/sqx/modules/app/controller/app/AppController.java @@ -13,6 +13,7 @@ import com.sqx.modules.app.annotation.LoginUser; import com.sqx.modules.app.entity.UserEntity; import com.sqx.modules.app.service.AppService; import com.sqx.modules.app.service.UserService; +import com.sqx.modules.common.service.CommonInfoService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.codec.digest.DigestUtils; @@ -33,6 +34,8 @@ public class AppController { private UserService userService; @Autowired private AppService appService; + @Autowired + private CommonInfoService commonRepository; @PostMapping("/authenticationRegister") @ApiOperation("认证创建账号") @@ -80,8 +83,8 @@ public class AppController { if (StrUtil.isEmpty(zhiFuBao) || StrUtil.isEmpty(zhiFuBaoName)) { return Result.error("支付宝账户及姓名不能为空!"); } - if (!DataLimitUtil.isAccessAllowed(zhiFuBao+zhiFuBaoName, 1, "month")) { - return Result.error("修改失败,相同支付宝账号每月仅可绑定一次"); + if (!DataLimitUtil.isAccessAllowed(zhiFuBao+zhiFuBaoName, Integer.parseInt(commonRepository.findOne(924).getValue()), "month")) { + return Result.error("修改失败,相同支付宝账号每月可绑定次数已用完"); } int count = userService.count(new QueryWrapper() .ne("user_id", userId) @@ -91,8 +94,8 @@ public class AppController { if (count > 0) { return Result.error("一个支付宝账号仅可绑定一个用户"); } - if (!ApiAccessLimitUtil.isAccessAllowed(userId.toString(), "updateZFB", 3, "month")) { - return Result.error("每月仅支持修改三次,请联系管理员"); + if (!ApiAccessLimitUtil.isAccessAllowed(userId.toString(), "updateZFB", Integer.parseInt(commonRepository.findOne(925).getValue()), "month")) { + return Result.error("每月可修改次数已用完,请联系管理员"); } UserEntity old = userService.getById(userId); String accountNo = old.getZhiFuBao();