From 4fe33b2bc5a188f9b9a770268730a1a14d94259c Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Wed, 30 Aug 2023 16:10:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=92=E8=89=B2=E6=8E=A5=E5=8F=A3=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- features/sys_role/api_sys_role.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/features/sys_role/api_sys_role.go b/features/sys_role/api_sys_role.go index 11b0d36e..3a6a3c5a 100644 --- a/features/sys_role/api_sys_role.go +++ b/features/sys_role/api_sys_role.go @@ -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)