mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-25 02:58:43 +08:00
fix(route): the whitelist should include basicRoutes (#1048)
* fix(table): recursive updateTableDataRecord 无刷新更新表格数据时,支持递归查找,用于树状数据时。同时新增 findTableDataRecord 函数,用于支持无刷新新增数据到树状表格中 * fix(router): whitelist include basicRoutes 白名单应包含不在菜单上出现的静态路由,否则在动态切换菜单 resetRouter 时会丢失这些,如在usePermission.resume中 * fix: get basicRoutes whitelist bad code
This commit is contained in:
parent
62f8468775
commit
1bb5156923
@ -2,10 +2,16 @@ import type { RouteRecordRaw } from 'vue-router';
|
|||||||
import type { App } from 'vue';
|
import type { App } from 'vue';
|
||||||
|
|
||||||
import { createRouter, createWebHashHistory } from 'vue-router';
|
import { createRouter, createWebHashHistory } from 'vue-router';
|
||||||
import { basicRoutes, LoginRoute } from './routes';
|
import { basicRoutes } from './routes';
|
||||||
import { REDIRECT_NAME } from './constant';
|
|
||||||
|
|
||||||
const WHITE_NAME_LIST = [LoginRoute.name, REDIRECT_NAME];
|
// 白名单应该包含基本静态路由
|
||||||
|
const WHITE_NAME_LIST: string[] = [];
|
||||||
|
const getRouteNames = (array: any[]) =>
|
||||||
|
array.forEach((item) => {
|
||||||
|
WHITE_NAME_LIST.push(item.name);
|
||||||
|
getRouteNames(item.children || []);
|
||||||
|
});
|
||||||
|
getRouteNames(basicRoutes);
|
||||||
|
|
||||||
// app router
|
// app router
|
||||||
export const router = createRouter({
|
export const router = createRouter({
|
||||||
|
Loading…
Reference in New Issue
Block a user