mirror of https://gitee.com/stylefeng/roses
【8.0.4】【sys】更新生成拖拽图的接口
parent
5e57f76383
commit
8846987c19
|
@ -17,6 +17,13 @@
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
|
<!--获取拖拽验证码图片-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.stylefeng.roses</groupId>
|
||||||
|
<artifactId>security-api</artifactId>
|
||||||
|
<version>${roses.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!--日志相关api-->
|
<!--日志相关api-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.stylefeng.roses</groupId>
|
<groupId>cn.stylefeng.roses</groupId>
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
package cn.stylefeng.roses.kernel.sys.modular.login.controller;
|
||||||
|
|
||||||
|
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
|
||||||
|
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
|
||||||
|
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||||
|
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||||
|
import cn.stylefeng.roses.kernel.security.api.DragCaptchaApi;
|
||||||
|
import cn.stylefeng.roses.kernel.security.api.pojo.DragCaptchaImageDTO;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图形验证码接口
|
||||||
|
*
|
||||||
|
* @author fengshuonan
|
||||||
|
* @since 2023/11/24 23:46
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@Slf4j
|
||||||
|
@ApiResource(name = "图形验证码接口")
|
||||||
|
public class CaptchaController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DragCaptchaApi dragCaptchaApi;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取拖拽验证码的图片
|
||||||
|
*
|
||||||
|
* @author fengshuonan
|
||||||
|
* @since 2023/11/24 23:47
|
||||||
|
*/
|
||||||
|
@GetResource(name = "获取拖拽验证码的图片", path = "/getDragCaptcha", requiredLogin = false)
|
||||||
|
public ResponseData<DragCaptchaImageDTO> getDragCaptcha() {
|
||||||
|
DragCaptchaImageDTO captcha = dragCaptchaApi.createCaptcha();
|
||||||
|
captcha.setLocationX(null);
|
||||||
|
captcha.setLocationY(null);
|
||||||
|
return new SuccessResponseData<>(captcha);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue