halo/console/console-src/modules/contents/pages/module.ts

60 lines
1.7 KiB
TypeScript
Raw Normal View History

refactor: router and menu generation (halo-dev/console#651) #### What type of PR is this? /kind api-change /kind improvement /milestone 2.0 #### What this PR does / why we need it: Ref https://github.com/halo-dev/halo/issues/2595 重构路由和侧边菜单生成的逻辑,**注意,此 PR 对插件的 Console 入口文件中的路由和菜单定义包含破坏性更新。** 1. 移除 `definePlugin` 方法的 `menus` 字段,改为在 route 的 meta 中定义。 2. 将 `RoutesMenu` 组件从 `@halo-dev/components` 包中移出。 3. 将 `BasicLayout` 组件从 `@halo-dev/console-shared` 包中移出。 定义路由的方式: ```ts import { definePlugin } from "@halo-dev/console-shared"; import BasicLayout from "@/layouts/BasicLayout.vue"; import AttachmentList from "./AttachmentList.vue"; import AttachmentSelectorModal from "./components/AttachmentSelectorModal.vue"; import { IconFolder } from "@halo-dev/components"; import { markRaw } from "vue"; export default definePlugin({ name: "attachmentModule", components: [AttachmentSelectorModal], routes: [ { path: "/attachments", component: BasicLayout, children: [ { path: "", name: "Attachments", component: AttachmentList, meta: { title: "附件", permissions: ["system:attachments:view"], menu: { name: "附件", group: "内容", icon: markRaw(IconFolder), priority: 4, mobile: true, }, }, }, ], }, ], }); ``` menu 字段类型: ```ts interface RouteMeta { title?: string; searchable?: boolean; permissions?: string[]; menu?: { name: string; group?: string; icon?: Component; priority: number; mobile?: true; }; } ``` 插件适配需要做的改动: 1. 移除 `definePlugin` 中的 menus 字段。 2. 在需要添加到菜单的 route 中提供 `meta.menu` 对象,可参考上方的 menu 字段类型。 详细文档可查阅:https://github.com/ruibaby/halo-console/tree/refactor/route-map-setting/docs/routes-generation todolist: - [x] 完善预设的菜单分组定义。 - [x] 绑定权限,根据权限决定是否需要将路由添加到菜单。 - [x] 优化菜单排序的定义方式。 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/2595 #### Special notes for your reviewer: /cc @halo-dev/sig-halo-console 测试方式: 1. 需要 `pnpm build:packages` 2. 测试后台的菜单及路由是否有异常。 3. 新建角色测试路由和菜单对权限的绑定。 4. 按照 https://github.com/ruibaby/halo-console/tree/refactor/route-map-setting/docs/routes-generation 文档,创建插件,测试插件添加路由和菜单是否正常。 #### Does this PR introduce a user-facing change? ```release-note 重构路由和侧边菜单生成的逻辑。 ```
2022-10-19 08:54:13 +00:00
import { definePlugin } from "@halo-dev/console-shared";
import BasicLayout from "@console/layouts/BasicLayout.vue";
import SinglePageList from "./SinglePageList.vue";
import DeletedSinglePageList from "./DeletedSinglePageList.vue";
import SinglePageEditor from "./SinglePageEditor.vue";
import SinglePageStatsWidget from "./widgets/SinglePageStatsWidget.vue";
import { IconPages } from "@halo-dev/components";
refactor: router and menu generation (halo-dev/console#651) #### What type of PR is this? /kind api-change /kind improvement /milestone 2.0 #### What this PR does / why we need it: Ref https://github.com/halo-dev/halo/issues/2595 重构路由和侧边菜单生成的逻辑,**注意,此 PR 对插件的 Console 入口文件中的路由和菜单定义包含破坏性更新。** 1. 移除 `definePlugin` 方法的 `menus` 字段,改为在 route 的 meta 中定义。 2. 将 `RoutesMenu` 组件从 `@halo-dev/components` 包中移出。 3. 将 `BasicLayout` 组件从 `@halo-dev/console-shared` 包中移出。 定义路由的方式: ```ts import { definePlugin } from "@halo-dev/console-shared"; import BasicLayout from "@/layouts/BasicLayout.vue"; import AttachmentList from "./AttachmentList.vue"; import AttachmentSelectorModal from "./components/AttachmentSelectorModal.vue"; import { IconFolder } from "@halo-dev/components"; import { markRaw } from "vue"; export default definePlugin({ name: "attachmentModule", components: [AttachmentSelectorModal], routes: [ { path: "/attachments", component: BasicLayout, children: [ { path: "", name: "Attachments", component: AttachmentList, meta: { title: "附件", permissions: ["system:attachments:view"], menu: { name: "附件", group: "内容", icon: markRaw(IconFolder), priority: 4, mobile: true, }, }, }, ], }, ], }); ``` menu 字段类型: ```ts interface RouteMeta { title?: string; searchable?: boolean; permissions?: string[]; menu?: { name: string; group?: string; icon?: Component; priority: number; mobile?: true; }; } ``` 插件适配需要做的改动: 1. 移除 `definePlugin` 中的 menus 字段。 2. 在需要添加到菜单的 route 中提供 `meta.menu` 对象,可参考上方的 menu 字段类型。 详细文档可查阅:https://github.com/ruibaby/halo-console/tree/refactor/route-map-setting/docs/routes-generation todolist: - [x] 完善预设的菜单分组定义。 - [x] 绑定权限,根据权限决定是否需要将路由添加到菜单。 - [x] 优化菜单排序的定义方式。 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/2595 #### Special notes for your reviewer: /cc @halo-dev/sig-halo-console 测试方式: 1. 需要 `pnpm build:packages` 2. 测试后台的菜单及路由是否有异常。 3. 新建角色测试路由和菜单对权限的绑定。 4. 按照 https://github.com/ruibaby/halo-console/tree/refactor/route-map-setting/docs/routes-generation 文档,创建插件,测试插件添加路由和菜单是否正常。 #### Does this PR introduce a user-facing change? ```release-note 重构路由和侧边菜单生成的逻辑。 ```
2022-10-19 08:54:13 +00:00
import { markRaw } from "vue";
export default definePlugin({
components: {
SinglePageStatsWidget,
},
routes: [
{
refactor: refactor the page management and remove the function page (halo-dev/console#816) #### What type of PR is this? /kind api-change /kind improvement #### What this PR does / why we need it: 1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。 2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。 原由请看:https://github.com/halo-dev/halo/issues/3124 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/3124 #### Screenshots: <img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png"> 插件需要自己定义菜单配置,如: <img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png"> ```diff export default definePlugin({ - name: "PluginLinks", components: {}, routes: [ { parentName: "Root", route: { - path: "/pages/functional/links", + path: "/links", name: "Links", component: LinkList, meta: { permissions: ["plugin:links:view"], + menu: { + name: "链接", + group: "content", + icon: markRaw(RiLinksLine), + }, }, }, }, ], - extensionPoints: { - "page:functional:create": () => { - return [ - { - name: "链接", - url: "/links", - path: "/pages/functional/links", - permissions: ["plugin:links:view"], - }, - ]; - }, - }, }); ``` #### Special notes for your reviewer: 测试方式: 1. 测试左侧菜单的页面入口是否正常。 2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。 3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip) #### Does this PR introduce a user-facing change? ```release-note 重构页面管理,移除功能页面的功能。 ```
2023-01-10 10:44:40 +00:00
path: "/single-pages",
component: BasicLayout,
children: [
{
refactor: refactor the page management and remove the function page (halo-dev/console#816) #### What type of PR is this? /kind api-change /kind improvement #### What this PR does / why we need it: 1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。 2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。 原由请看:https://github.com/halo-dev/halo/issues/3124 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/3124 #### Screenshots: <img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png"> 插件需要自己定义菜单配置,如: <img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png"> ```diff export default definePlugin({ - name: "PluginLinks", components: {}, routes: [ { parentName: "Root", route: { - path: "/pages/functional/links", + path: "/links", name: "Links", component: LinkList, meta: { permissions: ["plugin:links:view"], + menu: { + name: "链接", + group: "content", + icon: markRaw(RiLinksLine), + }, }, }, }, ], - extensionPoints: { - "page:functional:create": () => { - return [ - { - name: "链接", - url: "/links", - path: "/pages/functional/links", - permissions: ["plugin:links:view"], - }, - ]; - }, - }, }); ``` #### Special notes for your reviewer: 测试方式: 1. 测试左侧菜单的页面入口是否正常。 2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。 3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip) #### Does this PR introduce a user-facing change? ```release-note 重构页面管理,移除功能页面的功能。 ```
2023-01-10 10:44:40 +00:00
path: "",
name: "SinglePages",
component: SinglePageList,
meta: {
title: "core.page.title",
refactor: refactor the page management and remove the function page (halo-dev/console#816) #### What type of PR is this? /kind api-change /kind improvement #### What this PR does / why we need it: 1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。 2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。 原由请看:https://github.com/halo-dev/halo/issues/3124 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/3124 #### Screenshots: <img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png"> 插件需要自己定义菜单配置,如: <img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png"> ```diff export default definePlugin({ - name: "PluginLinks", components: {}, routes: [ { parentName: "Root", route: { - path: "/pages/functional/links", + path: "/links", name: "Links", component: LinkList, meta: { permissions: ["plugin:links:view"], + menu: { + name: "链接", + group: "content", + icon: markRaw(RiLinksLine), + }, }, }, }, ], - extensionPoints: { - "page:functional:create": () => { - return [ - { - name: "链接", - url: "/links", - path: "/pages/functional/links", - permissions: ["plugin:links:view"], - }, - ]; - }, - }, }); ``` #### Special notes for your reviewer: 测试方式: 1. 测试左侧菜单的页面入口是否正常。 2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。 3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip) #### Does this PR introduce a user-facing change? ```release-note 重构页面管理,移除功能页面的功能。 ```
2023-01-10 10:44:40 +00:00
searchable: true,
permissions: ["system:singlepages:view"],
menu: {
name: "core.sidebar.menu.items.single_pages",
refactor: refactor the page management and remove the function page (halo-dev/console#816) #### What type of PR is this? /kind api-change /kind improvement #### What this PR does / why we need it: 1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。 2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。 原由请看:https://github.com/halo-dev/halo/issues/3124 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/3124 #### Screenshots: <img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png"> 插件需要自己定义菜单配置,如: <img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png"> ```diff export default definePlugin({ - name: "PluginLinks", components: {}, routes: [ { parentName: "Root", route: { - path: "/pages/functional/links", + path: "/links", name: "Links", component: LinkList, meta: { permissions: ["plugin:links:view"], + menu: { + name: "链接", + group: "content", + icon: markRaw(RiLinksLine), + }, }, }, }, ], - extensionPoints: { - "page:functional:create": () => { - return [ - { - name: "链接", - url: "/links", - path: "/pages/functional/links", - permissions: ["plugin:links:view"], - }, - ]; - }, - }, }); ``` #### Special notes for your reviewer: 测试方式: 1. 测试左侧菜单的页面入口是否正常。 2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。 3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip) #### Does this PR introduce a user-facing change? ```release-note 重构页面管理,移除功能页面的功能。 ```
2023-01-10 10:44:40 +00:00
group: "content",
icon: markRaw(IconPages),
priority: 1,
},
refactor: refactor the page management and remove the function page (halo-dev/console#816) #### What type of PR is this? /kind api-change /kind improvement #### What this PR does / why we need it: 1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。 2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。 原由请看:https://github.com/halo-dev/halo/issues/3124 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/3124 #### Screenshots: <img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png"> 插件需要自己定义菜单配置,如: <img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png"> ```diff export default definePlugin({ - name: "PluginLinks", components: {}, routes: [ { parentName: "Root", route: { - path: "/pages/functional/links", + path: "/links", name: "Links", component: LinkList, meta: { permissions: ["plugin:links:view"], + menu: { + name: "链接", + group: "content", + icon: markRaw(RiLinksLine), + }, }, }, }, ], - extensionPoints: { - "page:functional:create": () => { - return [ - { - name: "链接", - url: "/links", - path: "/pages/functional/links", - permissions: ["plugin:links:view"], - }, - ]; - }, - }, }); ``` #### Special notes for your reviewer: 测试方式: 1. 测试左侧菜单的页面入口是否正常。 2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。 3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip) #### Does this PR introduce a user-facing change? ```release-note 重构页面管理,移除功能页面的功能。 ```
2023-01-10 10:44:40 +00:00
},
},
{
refactor: refactor the page management and remove the function page (halo-dev/console#816) #### What type of PR is this? /kind api-change /kind improvement #### What this PR does / why we need it: 1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。 2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。 原由请看:https://github.com/halo-dev/halo/issues/3124 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/3124 #### Screenshots: <img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png"> 插件需要自己定义菜单配置,如: <img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png"> ```diff export default definePlugin({ - name: "PluginLinks", components: {}, routes: [ { parentName: "Root", route: { - path: "/pages/functional/links", + path: "/links", name: "Links", component: LinkList, meta: { permissions: ["plugin:links:view"], + menu: { + name: "链接", + group: "content", + icon: markRaw(RiLinksLine), + }, }, }, }, ], - extensionPoints: { - "page:functional:create": () => { - return [ - { - name: "链接", - url: "/links", - path: "/pages/functional/links", - permissions: ["plugin:links:view"], - }, - ]; - }, - }, }); ``` #### Special notes for your reviewer: 测试方式: 1. 测试左侧菜单的页面入口是否正常。 2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。 3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip) #### Does this PR introduce a user-facing change? ```release-note 重构页面管理,移除功能页面的功能。 ```
2023-01-10 10:44:40 +00:00
path: "deleted",
name: "DeletedSinglePages",
component: DeletedSinglePageList,
meta: {
title: "core.deleted_page.title",
refactor: refactor the page management and remove the function page (halo-dev/console#816) #### What type of PR is this? /kind api-change /kind improvement #### What this PR does / why we need it: 1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。 2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。 原由请看:https://github.com/halo-dev/halo/issues/3124 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/3124 #### Screenshots: <img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png"> 插件需要自己定义菜单配置,如: <img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png"> ```diff export default definePlugin({ - name: "PluginLinks", components: {}, routes: [ { parentName: "Root", route: { - path: "/pages/functional/links", + path: "/links", name: "Links", component: LinkList, meta: { permissions: ["plugin:links:view"], + menu: { + name: "链接", + group: "content", + icon: markRaw(RiLinksLine), + }, }, }, }, ], - extensionPoints: { - "page:functional:create": () => { - return [ - { - name: "链接", - url: "/links", - path: "/pages/functional/links", - permissions: ["plugin:links:view"], - }, - ]; - }, - }, }); ``` #### Special notes for your reviewer: 测试方式: 1. 测试左侧菜单的页面入口是否正常。 2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。 3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip) #### Does this PR introduce a user-facing change? ```release-note 重构页面管理,移除功能页面的功能。 ```
2023-01-10 10:44:40 +00:00
searchable: true,
permissions: ["system:singlepages:view"],
},
},
{
path: "editor",
name: "SinglePageEditor",
component: SinglePageEditor,
meta: {
title: "core.page_editor.title",
refactor: refactor the page management and remove the function page (halo-dev/console#816) #### What type of PR is this? /kind api-change /kind improvement #### What this PR does / why we need it: 1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。 2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。 原由请看:https://github.com/halo-dev/halo/issues/3124 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/3124 #### Screenshots: <img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png"> 插件需要自己定义菜单配置,如: <img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png"> ```diff export default definePlugin({ - name: "PluginLinks", components: {}, routes: [ { parentName: "Root", route: { - path: "/pages/functional/links", + path: "/links", name: "Links", component: LinkList, meta: { permissions: ["plugin:links:view"], + menu: { + name: "链接", + group: "content", + icon: markRaw(RiLinksLine), + }, }, }, }, ], - extensionPoints: { - "page:functional:create": () => { - return [ - { - name: "链接", - url: "/links", - path: "/pages/functional/links", - permissions: ["plugin:links:view"], - }, - ]; - }, - }, }); ``` #### Special notes for your reviewer: 测试方式: 1. 测试左侧菜单的页面入口是否正常。 2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。 3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip) #### Does this PR introduce a user-facing change? ```release-note 重构页面管理,移除功能页面的功能。 ```
2023-01-10 10:44:40 +00:00
searchable: true,
hideFooter: true,
refactor: refactor the page management and remove the function page (halo-dev/console#816) #### What type of PR is this? /kind api-change /kind improvement #### What this PR does / why we need it: 1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。 2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。 原由请看:https://github.com/halo-dev/halo/issues/3124 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/3124 #### Screenshots: <img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png"> 插件需要自己定义菜单配置,如: <img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png"> ```diff export default definePlugin({ - name: "PluginLinks", components: {}, routes: [ { parentName: "Root", route: { - path: "/pages/functional/links", + path: "/links", name: "Links", component: LinkList, meta: { permissions: ["plugin:links:view"], + menu: { + name: "链接", + group: "content", + icon: markRaw(RiLinksLine), + }, }, }, }, ], - extensionPoints: { - "page:functional:create": () => { - return [ - { - name: "链接", - url: "/links", - path: "/pages/functional/links", - permissions: ["plugin:links:view"], - }, - ]; - }, - }, }); ``` #### Special notes for your reviewer: 测试方式: 1. 测试左侧菜单的页面入口是否正常。 2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。 3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip) #### Does this PR introduce a user-facing change? ```release-note 重构页面管理,移除功能页面的功能。 ```
2023-01-10 10:44:40 +00:00
permissions: ["system:singlepages:manage"],
},
},
],
},
],
});