From ecaf8edf14e5a9d9c8e09f7d178e3acf660b32f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Thu, 27 Jul 2023 00:47:54 +0800 Subject: [PATCH] feat: fix status --- app/http/middleware/jwt.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/http/middleware/jwt.go b/app/http/middleware/jwt.go index 1bd17f46..ebc87c65 100644 --- a/app/http/middleware/jwt.go +++ b/app/http/middleware/jwt.go @@ -28,7 +28,7 @@ func Jwt() http.Middleware { token, err = facades.Auth().Refresh(ctx) if err != nil { // Refresh time exceeded - ctx.Request().AbortWithStatusJson(http.StatusUnauthorized, http.Json{ + ctx.Request().AbortWithStatusJson(http.StatusOK, http.Json{ "code": 401, "message": "登录已过期", }) @@ -37,7 +37,7 @@ func Jwt() http.Middleware { token = "Bearer " + token } else { - ctx.Request().AbortWithStatusJson(http.StatusUnauthorized, http.Json{ + ctx.Request().AbortWithStatusJson(http.StatusOK, http.Json{ "code": 401, "message": "登录已过期", })