mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-12-30 11:26:35 +08:00
refactor: dbm
This commit is contained in:
14
server/internal/auth/api/captcha.go
Normal file
14
server/internal/auth/api/captcha.go
Normal file
@@ -0,0 +1,14 @@
|
||||
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}
|
||||
}
|
||||
Reference in New Issue
Block a user