未验证 提交 1bb51569 编写于 作者: L Leo Caan (陈栋) 提交者: GitHub

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
上级 62f84687
......@@ -2,10 +2,16 @@ import type { RouteRecordRaw } from 'vue-router';
import type { App } from 'vue';
import { createRouter, createWebHashHistory } from 'vue-router';
import { basicRoutes, LoginRoute } from './routes';
import { REDIRECT_NAME } from './constant';
import { basicRoutes } from './routes';
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
export const router = createRouter({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册