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) { 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); }