feat: add manager list page in console page

This commit is contained in:
RockYang
2024-03-21 15:24:28 +08:00
parent dece19cec6
commit ec6186596d
9 changed files with 367 additions and 10 deletions

View File

@@ -186,6 +186,9 @@ func authorizeMiddleware(s *AppServer, client *redis.Client) gin.HandlerFunc {
}
key := fmt.Sprintf("users/%v", claims["user_id"])
if isAdminApi {
key = fmt.Sprintf("admin/%v", claims["user_id"])
}
if _, err := client.Get(context.Background(), key).Result(); err != nil && needLogin(c) {
resp.NotAuth(c, "Token is not found in redis")
c.Abort()