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

13 lines
228 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-10-12 12:14:56 +08:00
"mayfly-go/pkg/utils/collx"
)
2023-01-14 16:29:52 +08:00
func GenerateCaptcha(rc *req.Ctx) {
id, image := captcha.Generate()
2023-10-12 12:14:56 +08:00
rc.ResData = collx.M{"base64Captcha": image, "cid": id}
}