captcha.go 617 B

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