fix: BUG修改

This commit is contained in:
kun 2024-03-14 11:45:24 +08:00
parent 4800c7176f
commit 7d6da6cafc

View File

@ -37,6 +37,7 @@ export const initDynamicRouter = async (params?: any, defaultUrl?: any) => {
// 3.添加动态路由
let toNum = 0; // 记录跳转数,只想跳转一次
console.log(authStore.flatMenuListGet);
authStore.flatMenuListGet.forEach((item: any, index: any) => {
item.children && delete item.children;
if (item.component && isType(item.component) == "string") {
@ -64,7 +65,7 @@ export const initDynamicRouter = async (params?: any, defaultUrl?: any) => {
router.push(item.path);
++toNum;
}
if (item.path != "/" && toNum < 1 && defaultUrl) {
if (item.path != "/" && toNum < 1 && defaultUrl && item.path == defaultUrl) {
router.push(defaultUrl);
++toNum;
}