|
|
|
@ -2,15 +2,13 @@ package cn.iocoder.yudao.module.system.controller.admin.captcha;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils;
|
|
|
|
import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.system.service.auth.AdminAuthService;
|
|
|
|
import com.xingyuv.captcha.model.common.ResponseModel;
|
|
|
|
import com.xingyuv.captcha.model.common.ResponseModel;
|
|
|
|
import com.xingyuv.captcha.model.vo.CaptchaVO;
|
|
|
|
import com.xingyuv.captcha.model.vo.CaptchaVO;
|
|
|
|
import com.xingyuv.captcha.service.CaptchaService;
|
|
|
|
import com.xingyuv.captcha.service.CaptchaService;
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.security.PermitAll;
|
|
|
|
import javax.annotation.security.PermitAll;
|
|
|
|
@ -23,7 +21,15 @@ public class CaptchaController {
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private CaptchaService captchaService;
|
|
|
|
private CaptchaService captchaService;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private AdminAuthService authService;
|
|
|
|
|
|
|
|
@GetMapping({"/isEnable"})
|
|
|
|
|
|
|
|
@Operation(summary ="是否开启验证码")
|
|
|
|
|
|
|
|
@PermitAll
|
|
|
|
|
|
|
|
public ResponseModel get() {
|
|
|
|
|
|
|
|
boolean isEnable = authService.getCaptchaEnable();
|
|
|
|
|
|
|
|
return ResponseModel.successData(isEnable);
|
|
|
|
|
|
|
|
}
|
|
|
|
@PostMapping({"/get"})
|
|
|
|
@PostMapping({"/get"})
|
|
|
|
@Operation(summary = "获得验证码")
|
|
|
|
@Operation(summary = "获得验证码")
|
|
|
|
@PermitAll
|
|
|
|
@PermitAll
|
|
|
|
|