liujie
2026-04-03 199b087e97231bc602cd5ed8668f37d6f336dff4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.xiaopeng.account.controller;
 
import com.xiaopeng.account.service.IValidateCodeService;
import com.xiaopeng.common.core.exception.CaptchaException;
import com.xiaopeng.common.core.web.domain.AjaxResult;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.io.IOException;
 
/**
 * 图形验证码控制器
 *
 * @author ruoyi
 */
@RestController
@RequiredArgsConstructor(onConstructor_ = @Lazy)
public class CaptchaController {
 
    private final IValidateCodeService validateCodeService;
 
    @ApiOperation(value = "获取图形验证码", tags = {"管理后台-用户登录"})
    @GetMapping("/base/v1/captcha")
    public AjaxResult captcha() throws CaptchaException, IOException {
        return validateCodeService.createCaptcha();
    }
}