feat✨优化字典数据错误判断写法

This commit is contained in:
zhangwenjian authored and wenjianzhang committed 2021-05-08 13:53:27 +08:00
1 parent c6d94c03fb
commit c6a52134b3
69 files changed
+591 -479

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
package apis
import (
"github.com/gin-gonic/gin"
"github.com/go-admin-team/go-admin-core/sdk/pkg/captcha"
"go-admin/common/apis"
)
type System struct {
apis.Api
}
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(500, err, "验证码获取失败")
return
}
e.Custom(gin.H{
"code": 200,
"data": b64s,
"id": id,
"msg": "success",
})
}