feat ✨ 优化api写法
This commit is contained in:
1 parent
5957fb280c
commit
13ff9d9e63
38 files changed
+777
-672
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user