fix: BUG修改
This commit is contained in:
parent
4800c7176f
commit
7d6da6cafc
@ -37,6 +37,7 @@ export const initDynamicRouter = async (params?: any, defaultUrl?: any) => {
|
|||||||
|
|
||||||
// 3.添加动态路由
|
// 3.添加动态路由
|
||||||
let toNum = 0; // 记录跳转数,只想跳转一次
|
let toNum = 0; // 记录跳转数,只想跳转一次
|
||||||
|
console.log(authStore.flatMenuListGet);
|
||||||
authStore.flatMenuListGet.forEach((item: any, index: any) => {
|
authStore.flatMenuListGet.forEach((item: any, index: any) => {
|
||||||
item.children && delete item.children;
|
item.children && delete item.children;
|
||||||
if (item.component && isType(item.component) == "string") {
|
if (item.component && isType(item.component) == "string") {
|
||||||
@ -64,7 +65,7 @@ export const initDynamicRouter = async (params?: any, defaultUrl?: any) => {
|
|||||||
router.push(item.path);
|
router.push(item.path);
|
||||||
++toNum;
|
++toNum;
|
||||||
}
|
}
|
||||||
if (item.path != "/" && toNum < 1 && defaultUrl) {
|
if (item.path != "/" && toNum < 1 && defaultUrl && item.path == defaultUrl) {
|
||||||
router.push(defaultUrl);
|
router.push(defaultUrl);
|
||||||
++toNum;
|
++toNum;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user