|
@@ -36,7 +36,7 @@ function selectRoutes(routes, names) {
|
|
|
const initDynamicRoutesFunc = () => {
|
|
|
let [...defRoutes] = defaultRoutes
|
|
|
let authorityNameArr = initauthorityNameArr(JSON.parse(getCookie('authority'))[0].children,[])
|
|
|
- let selectedRoutes = selectRoutes(defRoutes[0].children, authorityNameArr)
|
|
|
+ let selectedRoutes = selectRoutes(defRoutes[0].children, authorityNameArr.length>0? authorityNameArr: ["Home"]) // 权限为空时默认加入首页
|
|
|
defRoutes[0].children = selectedRoutes
|
|
|
resetRouter()
|
|
|
router.options.routes = defRoutes
|