fix🐛: 自定义错误中间件bug修复

This commit is contained in:
zhangwenjian committed 2022-07-29 18:43:38 +08:00
1 parent b31e1c0d58
commit 0f1b9369df
1 file changed
+5
+5
View File
@@ -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)