Commit b43465d1 authored by 李苏's avatar 李苏 💬

ROUTER POWER REWRiTING=>FILTER HASMKID=TRUE

parent 9930a6a5
...@@ -115,9 +115,10 @@ const permission = { ...@@ -115,9 +115,10 @@ const permission = {
/* 权限路由*/ /* 权限路由*/
/* */ /* */
function filter(data) { function filter(data) {
var newData = data.filter( var newData = data.filter(
(item) => { (item) => {
let hasMkid = false let hasMkid = true
asymenus.forEach(e => { asymenus.forEach(e => {
if ((e.mkid == item.meta.mkid) || (item.meta.mkid == 'test')) { if ((e.mkid == item.meta.mkid) || (item.meta.mkid == 'test')) {
item.meta.icon = e.icon item.meta.icon = e.icon
...@@ -140,6 +141,7 @@ const permission = { ...@@ -140,6 +141,7 @@ const permission = {
let newPowerRoutes = filter(powerRoutes) let newPowerRoutes = filter(powerRoutes)
let newCommonList = filter(commonList.list) let newCommonList = filter(commonList.list)
let newErpList = filter(erpList.list) let newErpList = filter(erpList.list)
/* 转化菜单格式*/ /* 转化菜单格式*/
let delArr = [] let delArr = []
let newmenus = [] let newmenus = []
...@@ -154,7 +156,6 @@ const permission = { ...@@ -154,7 +156,6 @@ const permission = {
res.data = dynamicRouter([...newCommonList, ...newErpList, ...newPowerRoutes], asymenus) || [... res.data = dynamicRouter([...newCommonList, ...newErpList, ...newPowerRoutes], asymenus) || [...
newCommonList, ...newErpList, ...newPowerRoutes newCommonList, ...newErpList, ...newPowerRoutes
] ]
console.log(res.data,'router finally')
/* 重置首页路由*/ /* 重置首页路由*/
// let hompePage = treeToList([...newCommonList,...newErpList,...newPowerRoutes]).filter(item=>item.mkid==localStorage.getItem('homeMkid')) // let hompePage = treeToList([...newCommonList,...newErpList,...newPowerRoutes]).filter(item=>item.mkid==localStorage.getItem('homeMkid'))
let ttlist = treeToList([...newCommonList, ...newErpList, ...newPowerRoutes]) let ttlist = treeToList([...newCommonList, ...newErpList, ...newPowerRoutes])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment