初始
This commit is contained in:
32
internal/app/common/controller/captcha.go
Normal file
32
internal/app/common/controller/captcha.go
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* @desc:验证码获取
|
||||
* @company:云南奇讯科技有限公司
|
||||
* @Author: yixiaohu
|
||||
* @Date: 2022/3/2 17:45
|
||||
*/
|
||||
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/tiger1103/gfast/v3/api/v1/common"
|
||||
"github.com/tiger1103/gfast/v3/internal/app/common/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
|
||||
}
|
||||
Reference in New Issue
Block a user