From 622d4ac1654502703d96b382ccb9db91d6827267 Mon Sep 17 00:00:00 2001 From: UlricQin Date: Wed, 1 Dec 2021 10:14:35 +0800 Subject: [PATCH] refactor --- Makefile | 2 +- README.md | 11 ++++++++++- src/webapi/router/router_login.go | 10 +++++----- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index e570d62e..f3dc46d2 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ NOW = $(shell date -u '+%Y%m%d%I%M%S') -RELEASE_VERSION = 5.1.0 +RELEASE_VERSION = 5.0.0 APP = n9e SERVER_BIN = ${APP} diff --git a/README.md b/README.md index bf560c86..8acc980d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,16 @@ -## Intro +## 简介 Nightingale, Prometheus enterprise edition +## 注意 + +v5正式版还没发布,预计12月中旬发布 + +## 文档 + +- 国外:[https://n9e.github.io/](https://n9e.github.io/) +- 国内:[https://n9e.gitee.io/](https://n9e.gitee.io/) +- [v4老文档](https://gitee.com/n9e/book/tree/master/content/v4/docs) ## TODO diff --git a/src/webapi/router/router_login.go b/src/webapi/router/router_login.go index 13d41576..b92c0ecb 100644 --- a/src/webapi/router/router_login.go +++ b/src/webapi/router/router_login.go @@ -91,7 +91,7 @@ func refreshPost(c *gin.Context) { // if there is an error, the token must have expired if err != nil { // redirect to login page - ginx.NewRender(c).Message("refresh token expired") + ginx.NewRender(c, http.StatusUnauthorized).Message("refresh token expired") return } @@ -101,21 +101,21 @@ func refreshPost(c *gin.Context) { refreshUuid, ok := claims["refresh_uuid"].(string) //convert the interface to string if !ok { // Theoretically impossible - ginx.NewRender(c).Message("failed to parse refresh_uuid from jwt") + ginx.NewRender(c, http.StatusUnauthorized).Message("failed to parse refresh_uuid from jwt") return } userIdentity, ok := claims["user_identity"].(string) if !ok { // Theoretically impossible - ginx.NewRender(c).Message("failed to parse user_identity from jwt") + ginx.NewRender(c, http.StatusUnauthorized).Message("failed to parse user_identity from jwt") return } // Delete the previous Refresh Token err = deleteAuth(c.Request.Context(), refreshUuid) if err != nil { - ginx.NewRender(c).Message(InternalServerError) + ginx.NewRender(c, http.StatusUnauthorized).Message(InternalServerError) return } @@ -133,6 +133,6 @@ func refreshPost(c *gin.Context) { }, nil) } else { // redirect to login page - ginx.NewRender(c).Message("refresh token expired") + ginx.NewRender(c, http.StatusUnauthorized).Message("refresh token expired") } }