Files
mayfly-go/server/internal/sys/api/captcha.go

12 lines
206 B
Go
Raw Normal View History

2021-09-11 14:04:09 +08:00
package api
import (
"mayfly-go/pkg/captcha"
2023-01-14 16:29:52 +08:00
"mayfly-go/pkg/req"
)
2023-01-14 16:29:52 +08:00
func GenerateCaptcha(rc *req.Ctx) {
id, image := captcha.Generate()
rc.ResData = map[string]any{"base64Captcha": image, "cid": id}
}