app.go 378 B

123456789101112131415161718192021
  1. package login
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "go_server/base/core"
  5. "go_server/model/common/response"
  6. "go_server/service/base"
  7. )
  8. type AppService struct {
  9. base.SysCommonService
  10. }
  11. func (s *AppService) GenerateCaptcha(c *gin.Context) {
  12. bs64, cid := core.CapEngine().Generate()
  13. data := map[string]any{
  14. "cid": cid,
  15. "captcha": bs64,
  16. }
  17. response.Resp(c, data)
  18. }