feat ✨ 优化api写法

This commit is contained in:
linwenxiang committed 2021-04-27 10:06:22 +08:00
1 parent 5957fb280c
commit 13ff9d9e63
38 files changed
+777 -672

No files matched your search

+5 -4
View File
@@ -10,15 +10,16 @@ type System struct {
apis.Api
}
func (e *System) GenerateCaptchaHandler(c *gin.Context) {
log := e.GetLogger(c)
func (e System) GenerateCaptchaHandler(c *gin.Context) {
e.Context = c
log := e.GetLogger()
id, b64s, err := captcha.DriverDigitFunc()
if err != nil {
log.Errorf("DriverDigitFunc error, %s", err.Error())
e.Error(c, 500, err, "验证码获取失败")
e.Error(500, err, "验证码获取失败")
return
}
e.Custom(c, gin.H{
e.Custom(gin.H{
"code": 200,
"data": b64s,
"id": id,