ソースを参照

!979 修复后端控制路由获取菜单树时path属性返回空值导 致前端添加路由报错,并添加注释
Merge pull request !979 from 刘强/next

zuohuaijun 2 年 前
コミット
280644b1d3
1 ファイル変更1 行追加1 行削除
  1. 1 1
      Web/src/router/backEnd.ts

+ 1 - 1
Web/src/router/backEnd.ts

@@ -136,7 +136,7 @@ export async function setBackEndControlRefreshRoutes() {
 export function backEndComponent(routes: any) {
 	if (!routes) return;
 	return routes.map((item: any) => {
-		if (item.path) item.path = "";
+		if (!item.path) item.path = ""; //此处是为了防止后端返回的路由没有path属性,导致路由报错
 		if (item.component) item.component = dynamicImport(dynamicViewsModules, item.component as string);
 		item.children && backEndComponent(item.children);
 		return item;