File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -15,12 +15,13 @@ var store = base64Captcha.DefaultMemStore
15
15
16
16
type BaseApi struct {}
17
17
18
+ // Captcha
18
19
// @Tags Base
19
20
// @Summary 生成验证码
20
21
// @Security ApiKeyAuth
21
22
// @accept application/json
22
23
// @Produce application/json
23
- // @Success 200 {string} string "{"success":true," data":{},"msg":"验证码获取成功"} "
24
+ // @Success 200 {object} response.Response{ data=systemRes.SysCaptchaResponse} "生成一个随机验证码,返回包括随机生成id,base64 图像字符串,验证码长度 "
24
25
// @Router /base/captcha [post]
25
26
func (b * BaseApi ) Captcha (c * gin.Context ) {
26
27
// 字符,公式,验证码配置
Original file line number Diff line number Diff line change 1
1
package response
2
2
3
3
type SysCaptchaResponse struct {
4
- CaptchaId string `json:"captchaId"`
5
- PicPath string `json:"picPath"`
6
- CaptchaLength int `json:"captchaLength""`
4
+ CaptchaId string `json:"captchaId" example:"axxbbas"` // 随机数id
5
+ PicPath string `json:"picPath" example:"data:img/png;base64,///"` // base64 图像字符串
6
+ CaptchaLength int `json:"captchaLength" example:"6"` // 验证码长度
7
7
}
You can’t perform that action at this time.
0 commit comments