mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue into dev
Conflicts: ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java ruoyi-ui/src/components/ImageUpload/index.vue ruoyi-ui/src/views/login.vue sql/ry_20210713.sql
This commit is contained in:
@ -14,6 +14,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.framework.captcha.UnsignedMathGenerator;
|
||||
import com.ruoyi.framework.config.properties.CaptchaProperties;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@ -26,7 +27,7 @@ import java.util.concurrent.TimeUnit;
|
||||
/**
|
||||
* 验证码操作处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @author ruoyi
|
||||
*/
|
||||
@RestController
|
||||
public class CaptchaController {
|
||||
@ -47,15 +48,18 @@ public class CaptchaController {
|
||||
@Autowired
|
||||
private CaptchaProperties captchaProperties;
|
||||
|
||||
@Autowired
|
||||
private ISysConfigService configService;
|
||||
|
||||
/**
|
||||
* 生成验证码
|
||||
*/
|
||||
@GetMapping("/captchaImage")
|
||||
public AjaxResult getCode() {
|
||||
Map<String, Object> ajax = new HashMap<>();
|
||||
Boolean enabled = captchaProperties.getEnabled();
|
||||
ajax.put("enabled", enabled);
|
||||
if (!enabled) {
|
||||
boolean captchaOnOff = configService.selectCaptchaOnOff();
|
||||
ajax.put("captchaOnOff", captchaOnOff);
|
||||
if (!captchaOnOff) {
|
||||
return AjaxResult.success(ajax);
|
||||
}
|
||||
// 保存验证码信息
|
||||
|
Reference in New Issue
Block a user