角色接口调整
This commit is contained in:
@@ -27,7 +27,7 @@ func Routers() []services.RouterItem {
|
||||
rs := [...]services.RouterItem{
|
||||
{
|
||||
Method: "GET",
|
||||
Pattern: "/roleManage/{apiVersion}/list",
|
||||
Pattern: "/roles",
|
||||
Handler: apis.List,
|
||||
Middleware: midware.Authorize(map[string][]string{
|
||||
"hasPerms": {"system:menu:list"},
|
||||
@@ -35,7 +35,7 @@ func Routers() []services.RouterItem {
|
||||
},
|
||||
{
|
||||
Method: "GET",
|
||||
Pattern: "/roleManage/{apiVersion}/info/{roleId}",
|
||||
Pattern: "/role/{roleId}",
|
||||
Handler: apis.Info,
|
||||
Middleware: midware.Authorize(map[string][]string{
|
||||
"hasPerms": {"system:menu:query"},
|
||||
@@ -43,7 +43,7 @@ func Routers() []services.RouterItem {
|
||||
},
|
||||
{
|
||||
Method: "POST",
|
||||
Pattern: "/roleManage/{apiVersion}/add",
|
||||
Pattern: "/role",
|
||||
Handler: apis.Add,
|
||||
Middleware: midware.Authorize(map[string][]string{
|
||||
"hasPerms": {"system:menu:add"},
|
||||
@@ -51,7 +51,7 @@ func Routers() []services.RouterItem {
|
||||
},
|
||||
{
|
||||
Method: "PUT",
|
||||
Pattern: "/roleManage/{apiVersion}/edit",
|
||||
Pattern: "/role",
|
||||
Handler: apis.Edit,
|
||||
Middleware: midware.Authorize(map[string][]string{
|
||||
"hasPerms": {"system:menu:edit"},
|
||||
@@ -59,7 +59,7 @@ func Routers() []services.RouterItem {
|
||||
},
|
||||
{
|
||||
Method: "DELETE",
|
||||
Pattern: "/roleManage/{apiVersion}/del/{roleIds}",
|
||||
Pattern: "/role/{roleIds}",
|
||||
Handler: apis.Remove,
|
||||
Middleware: midware.Authorize(map[string][]string{
|
||||
"hasPerms": {"system:menu:edit"},
|
||||
@@ -67,7 +67,7 @@ func Routers() []services.RouterItem {
|
||||
},
|
||||
{
|
||||
Method: "PUT",
|
||||
Pattern: "/roleManage/{apiVersion}/changeStatus",
|
||||
Pattern: "/role/changeStatus",
|
||||
Handler: apis.Status,
|
||||
Middleware: midware.Authorize(map[string][]string{
|
||||
"hasPerms": {"system:role:edit"},
|
||||
@@ -75,7 +75,7 @@ func Routers() []services.RouterItem {
|
||||
},
|
||||
{
|
||||
Method: "GET",
|
||||
Pattern: "/roleManage/{apiVersion}/authUser/allocatedList",
|
||||
Pattern: "/role/authUser/allocatedList",
|
||||
Handler: apis.AuthUserAllocatedList,
|
||||
Middleware: midware.Authorize(map[string][]string{
|
||||
"hasPerms": {"system:user:list"},
|
||||
@@ -83,7 +83,7 @@ func Routers() []services.RouterItem {
|
||||
},
|
||||
{
|
||||
Method: "PUT",
|
||||
Pattern: "/roleManage/{apiVersion}/authUser/checked",
|
||||
Pattern: "/role/authUser/checked",
|
||||
Handler: apis.AuthUserChecked,
|
||||
Middleware: midware.Authorize(map[string][]string{
|
||||
"hasPerms": {"system:role:edit"},
|
||||
@@ -95,7 +95,7 @@ func Routers() []services.RouterItem {
|
||||
// 生成两组前缀路由
|
||||
rsPrefix := []services.RouterItem{}
|
||||
for _, v := range rs {
|
||||
path := v.Pattern
|
||||
path := "/roleManage/{apiVersion}" + v.Pattern
|
||||
// 固定前缀
|
||||
v.Pattern = config.DefaultUriPrefix + path
|
||||
rsPrefix = append(rsPrefix, v)
|
||||
|
||||
Reference in New Issue
Block a user