Skip to content

Commit 8472126

Browse files
committed
fix: simplify error handling in GenerateCaptchaHandler
1 parent 3ab67df commit 8472126

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

app/admin/apis/captcha.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ type System struct {
1717
// @Success 200 {object} response.Response{data=string,id=string,msg=string} "{"code": 200, "data": [...]}"
1818
// @Router /api/v1/captcha [get]
1919
func (e System) GenerateCaptchaHandler(c *gin.Context) {
20-
err := e.MakeContext(c).Errors
21-
if err != nil {
20+
if err := e.MakeContext(c).Errors; err != nil {
2221
e.Error(500, err, "服务初始化失败!")
2322
return
2423
}

0 commit comments

Comments
 (0)