You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
560 B
32 lines
560 B
/* |
|
* @desc:验证码获取 |
|
* |
|
* |
|
* @Date: 2022/3/2 17:45 |
|
*/ |
|
|
|
package controller |
|
|
|
import ( |
|
"context" |
|
"tyj_admin/api/v1/common" |
|
"tyj_admin/internal/service" |
|
) |
|
|
|
var Captcha = captchaController{} |
|
|
|
type captchaController struct { |
|
} |
|
|
|
// Get 获取验证码 |
|
func (c *captchaController) Get(ctx context.Context, req *common.CaptchaReq) (res *common.CaptchaRes, err error) { |
|
var ( |
|
idKeyC, base64stringC string |
|
) |
|
idKeyC, base64stringC, err = service.Captcha().GetVerifyImgString(ctx) |
|
res = &common.CaptchaRes{ |
|
Key: idKeyC, |
|
Img: base64stringC, |
|
} |
|
return |
|
}
|
|
|