From 73db68b08b7975d84a24ea8838a96083a996c1fc Mon Sep 17 00:00:00 2001 From: 孤舟烟雨 <494979+gzyy@user.noreply.gitee.com> Date: 星期二, 12 七月 2022 21:02:08 +0800 Subject: [PATCH] !197 修改方法描述 * 修改方法描述 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java | 18 ++++++++---------- 1 files changed, 8 insertions(+), 10 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java index aa55c92..f4e7dff 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java @@ -5,6 +5,8 @@ import cn.hutool.core.convert.Convert; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.RandomUtil; +import com.ruoyi.common.annotation.Anonymous; +import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.enums.CaptchaType; @@ -17,9 +19,6 @@ import com.ruoyi.sms.core.SmsTemplate; import com.ruoyi.sms.entity.SmsResult; import com.ruoyi.system.service.ISysConfigService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; @@ -36,9 +35,9 @@ * * @author Lion Li */ +@Anonymous @Slf4j @Validated -@Api(value = "楠岃瘉鐮佹搷浣滃鐞�", tags = {"楠岃瘉鐮佺鐞�"}) @RequiredArgsConstructor @RestController public class CaptchaController { @@ -49,16 +48,16 @@ /** * 鐭俊楠岃瘉鐮� + * + * @param phonenumber 鐢ㄦ埛鎵嬫満鍙� */ - @ApiOperation("鐭俊楠岃瘉鐮�") @GetMapping("/captchaSms") - public R<Void> smsCaptcha(@ApiParam("鐢ㄦ埛鎵嬫満鍙�") - @NotBlank(message = "{user.phonenumber.not.blank}") + public R<Void> smsCaptcha(@NotBlank(message = "{user.phonenumber.not.blank}") String phonenumber) { if (smsProperties.getEnabled()) { R.fail("褰撳墠绯荤粺娌℃湁寮�鍚煭淇″姛鑳斤紒"); } - String key = Constants.CAPTCHA_CODE_KEY + phonenumber; + String key = CacheConstants.CAPTCHA_CODE_KEY + phonenumber; String code = RandomUtil.randomNumbers(4); RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION)); // 楠岃瘉鐮佹ā鏉縤d 鑷澶勭悊 (鏌ユ暟鎹簱鎴栧啓姝诲潎鍙�) @@ -77,7 +76,6 @@ /** * 鐢熸垚楠岃瘉鐮� */ - @ApiOperation("鐢熸垚楠岃瘉鐮�") @GetMapping("/captchaImage") public R<Map<String, Object>> getCode() { Map<String, Object> ajax = new HashMap<>(); @@ -88,7 +86,7 @@ } // 淇濆瓨楠岃瘉鐮佷俊鎭� String uuid = IdUtil.simpleUUID(); - String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid; + String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid; // 鐢熸垚楠岃瘉鐮� CaptchaType captchaType = captchaProperties.getType(); boolean isMath = CaptchaType.MATH == captchaType; -- Gitblit v1.9.3