fix: 统一业务响应状态码约定
This commit is contained in:
+1
-1
@@ -136,7 +136,7 @@ func BearerToken(header string) (string, error) {
|
||||
|
||||
func abortUnauthorized(c *gin.Context, message string) {
|
||||
Logger.Warn("JWT认证失败", zap.String("message", message), zap.String("path", c.Request.URL.Path))
|
||||
c.AbortWithStatusJSON(http.StatusUnauthorized, gin.H{"code": 401, "message": message, "data": nil})
|
||||
c.AbortWithStatusJSON(http.StatusOK, gin.H{"code": 401, "message": message, "data": nil})
|
||||
}
|
||||
|
||||
func GetCurrentUser(c *gin.Context) (int, string, bool) {
|
||||
|
||||
Reference in New Issue
Block a user