Files
gfast/internal/app/common/controller/captcah.go
T
2022-03-04 18:25:30 +08:00

33 lines
666 B
Go

/*
* @desc:验证码获取
* @company:云南奇讯科技有限公司
* @Author: yixiaohu
* @Date: 2022/3/2 17:45
*/
package controller
import (
"context"
"github.com/tiger1103/gfast/v3/apiv1/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
}