From 58c37ceb66151b7e0fe2eecb42f586f23fdfa6e3 Mon Sep 17 00:00:00 2001 From: Tankaikai Date: Mon, 10 Mar 2025 13:43:37 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=95=86=E5=93=81=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/czg/controller/admin/ProductController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cash-api/product-server/src/main/java/com/czg/controller/admin/ProductController.java b/cash-api/product-server/src/main/java/com/czg/controller/admin/ProductController.java index bd604014f..75c6c5747 100644 --- a/cash-api/product-server/src/main/java/com/czg/controller/admin/ProductController.java +++ b/cash-api/product-server/src/main/java/com/czg/controller/admin/ProductController.java @@ -115,7 +115,7 @@ public class ProductController { /** * 商品-上下架 */ - @PostMapping("on-off") + @PostMapping("onOff") @OperationLog("商品-上下架") //@SaAdminCheckPermission("product:on-off") public CzgResult onOffProduct(@RequestBody @Validated({DefaultGroup.class}) ProductIsSaleParam param) { From 0622e86cbf1acc9a9759868c48129b2c4868415c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=9D=BE?= <8605635+zhang3064194730@user.noreply.gitee.com> Date: Mon, 10 Mar 2025 13:48:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=AA=8C=E8=AF=81=E7=A0=81=E9=99=90?= =?UTF-8?q?=E5=88=B6=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/account/service/impl/CommonServiceImpl.java | 7 ++++++- .../service/account/service/impl/ShopInfoServiceImpl.java | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cash-service/account-service/src/main/java/com/czg/service/account/service/impl/CommonServiceImpl.java b/cash-service/account-service/src/main/java/com/czg/service/account/service/impl/CommonServiceImpl.java index 1169c276c..ce2eb299d 100644 --- a/cash-service/account-service/src/main/java/com/czg/service/account/service/impl/CommonServiceImpl.java +++ b/cash-service/account-service/src/main/java/com/czg/service/account/service/impl/CommonServiceImpl.java @@ -32,8 +32,13 @@ public class CommonServiceImpl implements CommonService { if (StrUtil.isBlank(sysUser.getPhone())) { throw new ApiNotPrintException("账号未绑定手机号"); } + String key = RedisCst.SMS_CODE + sysUser.getPhone() + ":" + type; + Object val = redisService.get(key); + if (val != null) { + throw new ApiNotPrintException("请勿频繁获取"); + } int code = RandomUtil.randomInt(100000, 1000000); - redisService.set(RedisCst.SMS_CODE + sysUser.getPhone() + ":" + type, code, 300); + redisService.set(key, code, 300); smsService.sendCode(sysUser.getPhone(), String.valueOf(code)); return true; } diff --git a/cash-service/account-service/src/main/java/com/czg/service/account/service/impl/ShopInfoServiceImpl.java b/cash-service/account-service/src/main/java/com/czg/service/account/service/impl/ShopInfoServiceImpl.java index 9a4f067e2..dc7491de1 100644 --- a/cash-service/account-service/src/main/java/com/czg/service/account/service/impl/ShopInfoServiceImpl.java +++ b/cash-service/account-service/src/main/java/com/czg/service/account/service/impl/ShopInfoServiceImpl.java @@ -159,6 +159,7 @@ public class ShopInfoServiceImpl extends ServiceImpl i } shopInfo.setOperationPwd(SecureUtil.md5(shopInfoEditDTO.getOperationPwd())); + redisService.del(key); } return updateById(shopInfo); }