Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -115,7 +115,7 @@ public class ProductController {
|
|||||||
/**
|
/**
|
||||||
* 商品-上下架
|
* 商品-上下架
|
||||||
*/
|
*/
|
||||||
@PostMapping("on-off")
|
@PostMapping("onOff")
|
||||||
@OperationLog("商品-上下架")
|
@OperationLog("商品-上下架")
|
||||||
//@SaAdminCheckPermission("product:on-off")
|
//@SaAdminCheckPermission("product:on-off")
|
||||||
public CzgResult<Void> onOffProduct(@RequestBody @Validated({DefaultGroup.class}) ProductIsSaleParam param) {
|
public CzgResult<Void> onOffProduct(@RequestBody @Validated({DefaultGroup.class}) ProductIsSaleParam param) {
|
||||||
|
|||||||
@@ -32,8 +32,13 @@ public class CommonServiceImpl implements CommonService {
|
|||||||
if (StrUtil.isBlank(sysUser.getPhone())) {
|
if (StrUtil.isBlank(sysUser.getPhone())) {
|
||||||
throw new ApiNotPrintException("账号未绑定手机号");
|
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);
|
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));
|
smsService.sendCode(sysUser.getPhone(), String.valueOf(code));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
shopInfo.setOperationPwd(SecureUtil.md5(shopInfoEditDTO.getOperationPwd()));
|
shopInfo.setOperationPwd(SecureUtil.md5(shopInfoEditDTO.getOperationPwd()));
|
||||||
|
redisService.del(key);
|
||||||
}
|
}
|
||||||
return updateById(shopInfo);
|
return updateById(shopInfo);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user