fix: 修正用户信息获取失败时的状态码
This commit is contained in:
4
main.go
4
main.go
@@ -92,10 +92,10 @@ func StartServerProxy() {
|
|||||||
user, err := utils.GetUserInfo(r.GetCtx())
|
user, err := utils.GetUserInfo(r.GetCtx())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
g.Log().Errorf(r.GetCtx(), "获取用户信息失败: %v", err)
|
g.Log().Errorf(r.GetCtx(), "获取用户信息失败: %v", err)
|
||||||
r.Response.Status = 500
|
r.Response.Status = 401
|
||||||
r.Response.WriteJsonExit(map[string]interface{}{
|
r.Response.WriteJsonExit(map[string]interface{}{
|
||||||
"success": false,
|
"success": false,
|
||||||
"code": 500,
|
"code": 401,
|
||||||
"message": "获取用户信息失败",
|
"message": "获取用户信息失败",
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user