feat(access): 实现基于用户角色的路由权限控制
添加权限检查功能,包括用户角色定义、路由元信息扩展和权限验证逻辑 重构路由配置和用户存储,支持动态菜单过滤 更新构建配置以支持类型声明生成
This commit is contained in:
@@ -1,8 +1,21 @@
|
||||
import type {RouteRecordRaw} from "vue-router";
|
||||
import type { RouteRecordRaw } from "vue-router";
|
||||
import HomeView from "../views/HomeView.vue";
|
||||
import AboutView from "../views/AboutView.vue";
|
||||
|
||||
import ACCESS_ENUM from "../access/accessEnum";
|
||||
/**
|
||||
* 路由配置
|
||||
*/
|
||||
export const routes: Array<RouteRecordRaw> = [
|
||||
{path: "/home", name: "HomeView", component: HomeView},
|
||||
{path: "/about", name: "AboutView", component: AboutView},
|
||||
{
|
||||
path: "/home",
|
||||
name: "HomeView",
|
||||
component: HomeView,
|
||||
meta: { hideInMenu: false, access: ACCESS_ENUM.NOT_LOGIN },
|
||||
},
|
||||
{
|
||||
path: "/about",
|
||||
name: "AboutView",
|
||||
component: AboutView,
|
||||
meta: { hideInMenu: false, access: ACCESS_ENUM.NOT_LOGIN },
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user