KKSU
2024-03-15 b87c5549fe471167882192944db3f2d6b729476c
src/main/java/cc/mrbird/febs/mall/controller/CommonController.java
@@ -1,6 +1,7 @@
package cc.mrbird.febs.mall.controller;
import cc.mrbird.febs.common.annotation.ControllerEndpoint;
import cc.mrbird.febs.common.annotation.Limit;
import cc.mrbird.febs.common.entity.FebsResponse;
import cc.mrbird.febs.common.exception.FebsException;
import cc.mrbird.febs.common.utils.*;
@@ -42,6 +43,7 @@
    @ApiOperation(value = "获取验证码接口", notes = "获取验证码通用接口")
    @GetMapping(value = "/verifyCode")
    @Limit(key = "verifyCode", period = 60, count = 2, name = "验证码接口", prefix = "limit")
    public FebsResponse verifyCode(@ApiParam(name = "account", value = "手机号", required = true) @RequestParam(value = "account") String account,
                                   @ApiParam(name = "type", value = "类型1-手机号", required = true) @RequestParam("type") String type) {
        log.info("#账号:{}, 类型:{}#", account, type);
@@ -53,7 +55,8 @@
        // 发送手机验证码
        if (AppContants.ACCOUNT_TYPE_MOBILE.equals(type)) {
            boolean result = ZzSmsSend.sendVerifyCode(account, code.toString(), 2);
//            boolean result = ZzSmsSend.sendVerifyCode(account, code.toString(), 2);
            boolean result = Sms106Send.sendVerifyCode(account, code.toString(), 2);
            if (result) {
                Map<String, Object> map = new HashMap<>();
                boolean flag = redisUtils.set(AppContants.VERIFY_CODE_PREFIX + account, code, 120);
@@ -146,6 +149,7 @@
    @ApiOperation(value = "验证验证码接口")
    @PostMapping(value = "/checkCode")
    @Limit(key = "verifyCode", period = 60, count = 2, name = "验证码接口", prefix = "limit")
    public FebsResponse checkCode(@RequestBody AccountAndCodeDto accountAndCodeDto) {
        boolean flag = commonService.verifyCode(accountAndCodeDto.getAccount(), accountAndCodeDto.getCode());