Files
mayfly-go/server/internal/auth/api/captcha.go
meilin.huang e56788af3e refactor: dbm
2024-12-08 13:04:23 +08:00

15 lines
334 B
Go

package api
import (
"mayfly-go/internal/auth/pkg/captcha"
"mayfly-go/pkg/biz"
"mayfly-go/pkg/req"
"mayfly-go/pkg/utils/collx"
)
func GenerateCaptcha(rc *req.Ctx) {
id, image, err := captcha.Generate()
biz.ErrIsNilAppendErr(err, "failed to generate the CAPTCHA: %s")
rc.ResData = collx.M{"base64Captcha": image, "cid": id}
}