From 60c1ec12b9c5d7cb5509ad109dda0847cdc57172 Mon Sep 17 00:00:00 2001 From: pixelmaxQM Date: Thu, 16 Apr 2026 10:05:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=92=8C=E8=AE=BE=E7=BD=AEAPI=E5=8F=8A=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E5=85=B3=E8=81=94=E8=A7=92=E8=89=B2=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/source/system/api.go | 4 ++++ server/source/system/casbin.go | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/server/source/system/api.go b/server/source/system/api.go index e1b466a02..e2fc0421e 100644 --- a/server/source/system/api.go +++ b/server/source/system/api.go @@ -78,6 +78,8 @@ func (i *initApi) InitializeData(ctx context.Context) (context.Context, error) { {ApiGroup: "api", Method: "GET", Path: "/api/getApiGroups", Description: "获取路由组"}, {ApiGroup: "api", Method: "POST", Path: "/api/enterSyncApi", Description: "确认同步API"}, {ApiGroup: "api", Method: "POST", Path: "/api/ignoreApi", Description: "忽略API"}, + {ApiGroup: "api", Method: "GET", Path: "/api/getApiRoles", Description: "获取指定API关联角色列表"}, + {ApiGroup: "api", Method: "POST", Path: "/api/setApiRoles", Description: "全量覆盖API关联角色列表"}, {ApiGroup: "角色", Method: "POST", Path: "/authority/copyAuthority", Description: "拷贝角色"}, {ApiGroup: "角色", Method: "POST", Path: "/authority/createAuthority", Description: "创建角色"}, @@ -100,6 +102,8 @@ func (i *initApi) InitializeData(ctx context.Context) (context.Context, error) { {ApiGroup: "菜单", Method: "POST", Path: "/menu/getBaseMenuTree", Description: "获取用户动态路由"}, {ApiGroup: "菜单", Method: "POST", Path: "/menu/getMenuAuthority", Description: "获取指定角色menu"}, {ApiGroup: "菜单", Method: "POST", Path: "/menu/addMenuAuthority", Description: "增加menu和角色关联关系"}, + {ApiGroup: "菜单", Method: "GET", Path: "/menu/getMenuRoles", Description: "获取菜单关联角色列表"}, + {ApiGroup: "菜单", Method: "POST", Path: "/menu/setMenuRoles", Description: "全量覆盖菜单关联角色列表"}, {ApiGroup: "分片上传", Method: "GET", Path: "/fileUploadAndDownload/findFile", Description: "寻找目标文件(秒传)"}, {ApiGroup: "分片上传", Method: "POST", Path: "/fileUploadAndDownload/breakpointContinue", Description: "断点续传"}, diff --git a/server/source/system/casbin.go b/server/source/system/casbin.go index 805d3c4df..3820a02f3 100644 --- a/server/source/system/casbin.go +++ b/server/source/system/casbin.go @@ -67,6 +67,8 @@ func (i *initCasbin) InitializeData(ctx context.Context) (context.Context, error {Ptype: "p", V0: "888", V1: "/api/getApiGroups", V2: "GET"}, {Ptype: "p", V0: "888", V1: "/api/enterSyncApi", V2: "POST"}, {Ptype: "p", V0: "888", V1: "/api/ignoreApi", V2: "POST"}, + {Ptype: "p", V0: "888", V1: "/api/getApiRoles", V2: "GET"}, + {Ptype: "p", V0: "888", V1: "/api/setApiRoles", V2: "POST"}, {Ptype: "p", V0: "888", V1: "/authority/copyAuthority", V2: "POST"}, {Ptype: "p", V0: "888", V1: "/authority/updateAuthority", V2: "PUT"}, @@ -83,6 +85,8 @@ func (i *initCasbin) InitializeData(ctx context.Context) (context.Context, error {Ptype: "p", V0: "888", V1: "/menu/getBaseMenuTree", V2: "POST"}, {Ptype: "p", V0: "888", V1: "/menu/addMenuAuthority", V2: "POST"}, {Ptype: "p", V0: "888", V1: "/menu/getMenuAuthority", V2: "POST"}, + {Ptype: "p", V0: "888", V1: "/menu/getMenuRoles", V2: "GET"}, + {Ptype: "p", V0: "888", V1: "/menu/setMenuRoles", V2: "POST"}, {Ptype: "p", V0: "888", V1: "/menu/deleteBaseMenu", V2: "POST"}, {Ptype: "p", V0: "888", V1: "/menu/updateBaseMenu", V2: "POST"}, {Ptype: "p", V0: "888", V1: "/menu/getBaseMenuById", V2: "POST"}, @@ -264,6 +268,8 @@ func (i *initCasbin) InitializeData(ctx context.Context) (context.Context, error {Ptype: "p", V0: "8881", V1: "/api/deleteApi", V2: "POST"}, {Ptype: "p", V0: "8881", V1: "/api/updateApi", V2: "POST"}, {Ptype: "p", V0: "8881", V1: "/api/getAllApis", V2: "POST"}, + {Ptype: "p", V0: "8881", V1: "/api/getApiRoles", V2: "GET"}, + {Ptype: "p", V0: "8881", V1: "/api/setApiRoles", V2: "POST"}, {Ptype: "p", V0: "8881", V1: "/authority/createAuthority", V2: "POST"}, {Ptype: "p", V0: "8881", V1: "/authority/deleteAuthority", V2: "POST"}, {Ptype: "p", V0: "8881", V1: "/authority/getAuthorityList", V2: "POST"}, @@ -276,6 +282,8 @@ func (i *initCasbin) InitializeData(ctx context.Context) (context.Context, error {Ptype: "p", V0: "8881", V1: "/menu/getBaseMenuTree", V2: "POST"}, {Ptype: "p", V0: "8881", V1: "/menu/addMenuAuthority", V2: "POST"}, {Ptype: "p", V0: "8881", V1: "/menu/getMenuAuthority", V2: "POST"}, + {Ptype: "p", V0: "8881", V1: "/menu/getMenuRoles", V2: "GET"}, + {Ptype: "p", V0: "8881", V1: "/menu/setMenuRoles", V2: "POST"}, {Ptype: "p", V0: "8881", V1: "/menu/deleteBaseMenu", V2: "POST"}, {Ptype: "p", V0: "8881", V1: "/menu/updateBaseMenu", V2: "POST"}, {Ptype: "p", V0: "8881", V1: "/menu/getBaseMenuById", V2: "POST"}, @@ -306,6 +314,8 @@ func (i *initCasbin) InitializeData(ctx context.Context) (context.Context, error {Ptype: "p", V0: "9528", V1: "/api/deleteApi", V2: "POST"}, {Ptype: "p", V0: "9528", V1: "/api/updateApi", V2: "POST"}, {Ptype: "p", V0: "9528", V1: "/api/getAllApis", V2: "POST"}, + {Ptype: "p", V0: "9528", V1: "/api/getApiRoles", V2: "GET"}, + {Ptype: "p", V0: "9528", V1: "/api/setApiRoles", V2: "POST"}, {Ptype: "p", V0: "9528", V1: "/authority/createAuthority", V2: "POST"}, {Ptype: "p", V0: "9528", V1: "/authority/deleteAuthority", V2: "POST"}, @@ -320,6 +330,8 @@ func (i *initCasbin) InitializeData(ctx context.Context) (context.Context, error {Ptype: "p", V0: "9528", V1: "/menu/getBaseMenuTree", V2: "POST"}, {Ptype: "p", V0: "9528", V1: "/menu/addMenuAuthority", V2: "POST"}, {Ptype: "p", V0: "9528", V1: "/menu/getMenuAuthority", V2: "POST"}, + {Ptype: "p", V0: "9528", V1: "/menu/getMenuRoles", V2: "GET"}, + {Ptype: "p", V0: "9528", V1: "/menu/setMenuRoles", V2: "POST"}, {Ptype: "p", V0: "9528", V1: "/menu/deleteBaseMenu", V2: "POST"}, {Ptype: "p", V0: "9528", V1: "/menu/updateBaseMenu", V2: "POST"}, {Ptype: "p", V0: "9528", V1: "/menu/getBaseMenuById", V2: "POST"},