| | |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.sign.Base64; |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | |
| | | |
| | | /** |
| | | * 验证码操作处理 |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | |
| | | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | /** |
| | | * 生成验证码 |
| | | */ |
| | | @GetMapping("/captchaImage") |
| | | public AjaxResult getCode(HttpServletResponse response) throws IOException |
| | | public Result getCode(HttpServletResponse response) throws IOException |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | Result ajax = Result.success(); |
| | | boolean captchaEnabled = configService.selectCaptchaEnabled(); |
| | | ajax.put("captchaEnabled", captchaEnabled); |
| | | if (!captchaEnabled) |
| | |
| | | } |
| | | catch (IOException e) |
| | | { |
| | | return AjaxResult.error(e.getMessage()); |
| | | return Result.error(e.getMessage()); |
| | | } |
| | | |
| | | ajax.put("uuid", uuid); |