fix🐛: 自定义错误中间件bug修复
This commit is contained in:
1 parent
b31e1c0d58
commit
0f1b9369df
1 file changed
+5
@@ -41,6 +41,11 @@ func CustomError(c *gin.Context) {
|
||||
"code": statusCode,
|
||||
"msg": p[2],
|
||||
})
|
||||
} else {
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"code": 500,
|
||||
"msg": "未知异常,请联系管理员!",
|
||||
})
|
||||
}
|
||||
default:
|
||||
panic(err)
|
||||
|
||||
Reference in new issue
Block a user