captcha.go 584 B

123456789101112131415161718192021
  1. package common
  2. import (
  3. "gfast/library/response"
  4. "gfast/library/service"
  5. "github.com/gogf/gf/frame/g"
  6. "github.com/gogf/gf/net/ghttp"
  7. )
  8. type Captcha struct{}
  9. // @Summary 获取验证码图片信息
  10. // @Description 获取验证码图片信息
  11. // @Tags 公共
  12. // @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
  13. // @Router /system/public/verify [post]
  14. // @Security
  15. func (p *Captcha) Img(r *ghttp.Request) {
  16. idKeyC, base64stringC := service.GetVerifyImgString()
  17. response.SusJson(true, r, "ok", g.MapStrStr{"idKeyC": idKeyC, "base64stringC": base64stringC})
  18. }