统一角色体系为admin/agent/user,修复代理查询角色错误,添加语言切换和明暗切换
This commit is contained in:
@@ -362,8 +362,8 @@ func handleInviteAgent(c *gin.Context) {
|
||||
response.Error(c, 404, "开发者不存在")
|
||||
return
|
||||
}
|
||||
if agent.Role != "developer" {
|
||||
response.Error(c, 400, "该用户不是开发者")
|
||||
if agent.Role != "agent" {
|
||||
response.Error(c, 400, "该用户不是代理商")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -421,8 +421,8 @@ func handleRequestAuthorization(c *gin.Context) {
|
||||
response.Error(c, 404, "开发者不存在")
|
||||
return
|
||||
}
|
||||
if developer.Role != "developer" {
|
||||
response.Error(c, 400, "该用户不是开发者")
|
||||
if developer.Role != "admin" {
|
||||
response.Error(c, 400, "该用户不是管理员")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user