mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-03 07:50:25 +08:00
15 lines
334 B
Go
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}
|
|
}
|