feat: reading permission from role

This commit is contained in:
oat_dev 2024-06-28 13:58:31 +07:00
parent 14e097bab4
commit f09e5c8066
2 changed files with 34 additions and 0 deletions

View file

@ -1,6 +1,25 @@
import type { RouteRecordRaw } from "vue-router";
const data = await fetch("/toc.json").then((r) => r.json());
const manual = data.filter((v: any) => v.children);
const mergeManual: any[] = [];
manual.forEach((v: any) => mergeManual.push(...v.children));
const manualRoute = mergeManual.map(
(v): { path: string; name: string; component: Function } => {
return {
path: v.path,
name: "Manual",
component: () => import("@/modules/01_manual/MainPage.vue"),
};
}
);
const route: RouteRecordRaw[] = [
// ...manualRoute,
{
path: "/manual/:name",
name: "Manual",