Merge branch 'main' of github.com:didi/nightingale

This commit is contained in:
Ulric Qin 2022-04-21 12:26:44 +08:00
commit 3921627fa2
3 changed files with 3 additions and 5 deletions

View File

@ -4,7 +4,7 @@ var (
dict = map[string]string{ dict = map[string]string{
"just a test": "这只是一个测试", "just a test": "这只是一个测试",
"just a test: %s": "这只是一个测试: %s", "just a test: %s": "这只是一个测试: %s",
"InternalServerError": "系统内部错误,请联系管理员", "Internal Server Error": "系统内部错误,请联系管理员",
"Username or password invalid": "登录失败,请检查用户名和密码", "Username or password invalid": "登录失败,请检查用户名和密码",
"Username is blank": "用户名不能为空", "Username is blank": "用户名不能为空",
"Username has invalid characters": "用户名含有非法字符", "Username has invalid characters": "用户名含有非法字符",

View File

@ -17,8 +17,6 @@ import (
promstat "github.com/didi/nightingale/v5/src/webapi/stat" promstat "github.com/didi/nightingale/v5/src/webapi/stat"
) )
var InternalServerError = "InternalServerError"
func stat() gin.HandlerFunc { func stat() gin.HandlerFunc {
return func(c *gin.Context) { return func(c *gin.Context) {
start := time.Now() start := time.Now()

View File

@ -68,7 +68,7 @@ func logoutPost(c *gin.Context) {
delErr := deleteTokens(c.Request.Context(), metadata) delErr := deleteTokens(c.Request.Context(), metadata)
if delErr != nil { if delErr != nil {
ginx.NewRender(c).Message(InternalServerError) ginx.NewRender(c).Message(http.StatusText(http.StatusInternalServerError))
return return
} }
@ -118,7 +118,7 @@ func refreshPost(c *gin.Context) {
// Delete the previous Refresh Token // Delete the previous Refresh Token
err = deleteAuth(c.Request.Context(), refreshUuid) err = deleteAuth(c.Request.Context(), refreshUuid)
if err != nil { if err != nil {
ginx.NewRender(c, http.StatusUnauthorized).Message(InternalServerError) ginx.NewRender(c, http.StatusUnauthorized).Message(http.StatusText(http.StatusInternalServerError))
return return
} }