pmg1989 / dva-admin

dva admin antd dashboard
https://pmg1989.github.io
MIT License
284 stars 93 forks source link

登录时getAllPathPowers方法的问题 #31

Open tianzhiyahaizhijiao opened 6 years ago

tianzhiyahaizhijiao commented 6 years ago

function getAllPathPowers (menuArray, curPowers) { return menuArray.reduce((dir, item) => { dir[/${item.key}] = curPowers[item.id] if (item.children) { item.children.reduce((cdir, cur) => { dir[/${cdir}/${cur.key}] = curPowers[cur.id] return cdir }, item.key) getAllPathPowers(item.children, curPowers) } return dir }, {}) }

这个封装的方法应该得不到所有的path

pmg1989 commented 6 years ago

嗯,有好的解决方法,欢迎pr给我