Browse Source

添加用户角色管理

2023
chenyifan01 2 years ago
parent
commit
4ac1523b7a
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      routers/api/v1/tech/tech.go

+ 1
- 1
routers/api/v1/tech/tech.go View File

@@ -257,7 +257,7 @@ func IsAdmin(ctx *context.APIContext) {
userName := ctx.Query("user") userName := ctx.Query("user")
user, err := models.GetUserByName(userName) user, err := models.GetUserByName(userName)
if err != nil { if err != nil {
ctx.JSON(http.StatusOK, response.ServerError("User not exists"))
ctx.JSON(http.StatusOK, response.OuterServerError("User not exists"))
return return
} }
isAdmin := role.UserHasRole(user.ID, models.TechProgramAdmin) isAdmin := role.UserHasRole(user.ID, models.TechProgramAdmin)


Loading…
Cancel
Save