From 62f8e2e703e056e54d738d0f08a21e507dbe816d Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Mon, 30 Jan 2023 14:38:12 +0800 Subject: [PATCH] refactor: use new apis to refactor plugins management (#824) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind improvement /milestone 2.2.x #### What this PR does / why we need it: 使用新的 API 来管理插件,用于区分插件管理和配置相关的权限。适配:https://github.com/halo-dev/halo/pull/3142 #### Which issue(s) this PR fixes: Ref https://github.com/halo-dev/halo/issues/3069 #### Screenshots: #### Special notes for your reviewer: 测试方式: 1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/3142 分支。 2. Console 需要 `pnpm install`。 1. 插件设置项,需要测试保存,安装新插件之后表单是否正常。 3. 创建一个角色,测试仅有管理/查看插件的角色,登录之后检查是否符合预期。 #### Does this PR introduce a user-facing change? ```release-note 重构 Console 端插件的设置表单逻辑。 ``` --- src/modules/system/plugins/PluginSetting.vue | 90 ++++++++++--------- .../system/plugins/layouts/PluginLayout.vue | 30 +++---- src/modules/system/plugins/module.ts | 2 +- 3 files changed, 59 insertions(+), 63 deletions(-) diff --git a/src/modules/system/plugins/PluginSetting.vue b/src/modules/system/plugins/PluginSetting.vue index a4a4287e..d53c0380 100644 --- a/src/modules/system/plugins/PluginSetting.vue +++ b/src/modules/system/plugins/PluginSetting.vue @@ -1,65 +1,67 @@ -
diff --git a/src/modules/system/plugins/module.ts b/src/modules/system/plugins/module.ts index dec39294..3b6a5b51 100644 --- a/src/modules/system/plugins/module.ts +++ b/src/modules/system/plugins/module.ts @@ -56,7 +56,7 @@ export default definePlugin({ component: PluginSetting, meta: { title: "插件设置", - permissions: ["system:settings:view"], + permissions: ["system:plugins:manage"], }, }, ],