修改验证码判断

This commit is contained in:
jiangzhe 2024-07-30 15:18:31 +08:00
parent 75ff22d8c9
commit dab19252bf
2 changed files with 3 additions and 2 deletions

View File

@ -79,7 +79,7 @@ public class AuthController {
* @param body 登录信息
* @return 结果
*/
@ApiEncrypt
// @ApiEncrypt
@PostMapping("/login")
public R<LoginVo> login(@RequestBody String body) {
LoginBody loginBody = JsonUtils.parseObject(body, LoginBody.class);

View File

@ -4,6 +4,7 @@ import cn.dev33.satoken.secure.BCrypt;
import cn.dev33.satoken.stp.SaLoginModel;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -59,7 +60,7 @@ public class PasswordAuthStrategy implements IAuthStrategy {
boolean captchaEnabled = captchaProperties.getEnable();
// 验证码开关
if (captchaEnabled) {
if (captchaEnabled && StrUtil.isNotBlank(code)) {
validateCaptcha(tenantId, username, code, uuid);
}