| 1234567891011121314151617181920212223242526272829303132 |
- /*
- * @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
- }
|