修改 ui 包结构.

This commit is contained in:
lijiahang
2023-07-29 13:11:19 +08:00
parent 900cd1c1d7
commit 5bee3b98a7
28 changed files with 149 additions and 365 deletions

View File

@@ -7,7 +7,10 @@ import setupRouteEmitterGuard from './router-listener-emitter';
* 创建路由守卫
*/
export default function createRouteGuard(router: Router) {
// 路由监听守卫
setupRouteEmitterGuard(router);
// 登录检查守卫
setupUserLoginInfoGuard(router);
// 权限检查守卫
setupPermissionGuard(router);
}

View File

@@ -24,9 +24,6 @@ export const LOGIN_ROUTER: RouteRecordRaw = {
path: '/login',
name: LOGIN_ROUTE_NAME,
component: () => import('@/views/login/index.vue'),
meta: {
requiresAuth: false,
},
};
/**
@@ -37,7 +34,6 @@ export const REDIRECT_ROUTER: RouteRecordRaw = {
name: 'redirectWrapper',
component: DEFAULT_LAYOUT,
meta: {
requiresAuth: true,
hideInMenu: true,
},
children: [
@@ -46,7 +42,6 @@ export const REDIRECT_ROUTER: RouteRecordRaw = {
name: REDIRECT_ROUTE_NAME,
component: () => import('@/views/redirect/index.vue'),
meta: {
requiresAuth: true,
hideInMenu: true,
},
},

View File

@@ -2,24 +2,13 @@ import { DEFAULT_LAYOUT } from '../base';
import { AppRouteRecordRaw } from '../types';
const DASHBOARD: AppRouteRecordRaw = {
path: '/dashboard',
name: 'dashboard',
component: DEFAULT_LAYOUT,
meta: {
locale: 'menu.dashboard',
requiresAuth: true,
icon: 'icon-dashboard',
order: 0,
},
children: [
{
path: 'workplace',
path: '/dashboard/workplace',
name: 'workplace',
component: () => import('@/views/dashboard/workplace/index.vue'),
meta: {
locale: 'menu.dashboard.workplace',
requiresAuth: true,
},
},
],
};

View File

@@ -2,24 +2,18 @@ import { DEFAULT_LAYOUT } from '../base';
import { AppRouteRecordRaw } from '../types';
const USER: AppRouteRecordRaw = {
path: '/user',
name: 'user',
component: DEFAULT_LAYOUT,
meta: {
locale: 'USER',
requiresAuth: true,
icon: 'icon-dashboard',
order: 0,
},
children: [
{
path: 'userChild',
name: 'userChild',
component: () => import('@/views/user/child/index.vue'),
meta: {
locale: '用户子页面',
requiresAuth: true,
},
path: '/user/userChild1',
name: 'userChild1',
component: () => import('@/views/user/child1/index.vue'),
},
{
path: '/user/userChild2',
name: 'userChild2',
component: () => import('@/views/user/child2/index.vue'),
},
],
};

View File

@@ -7,7 +7,7 @@ export type Component<T = any> =
| (() => Promise<T>);
export interface AppRouteRecordRaw {
path: string;
path?: string;
name?: string | symbol;
meta?: RouteMeta;
redirect?: string;

View File

@@ -2,15 +2,21 @@ import 'vue-router';
declare module 'vue-router' {
interface RouteMeta {
permission?: string;
requiresAuth: boolean;
// 后端赋值
icon?: string;
// 后端赋值
locale?: string;
hideInMenu?: boolean;
hideChildrenInMenu?: boolean;
activeMenu?: string;
// 后端赋值
order?: number;
// 后端赋值 是否隐藏菜单
hideInMenu?: boolean;
// 后端赋值 是否隐藏子菜单
hideChildrenInMenu?: boolean;
// 后端赋值 是否添加到 tab
noAffix?: boolean;
// 前端赋值 是否忽略缓存
ignoreCache?: boolean;
// 不赋值
activeMenu?: string;
}
}