Commit d04b925a by 姜雷

获取路由路径

parent 08ebb887
......@@ -32,7 +32,17 @@ const actions = {
}
commit(UPDATE_USERINFO, admin);
dispatch('initRoute', menu).then(() => {
resolve();
let path = '/';
if (menu.length) {
path += menu[0].menuUrl;
if (menu[0].childList && menu[0].childList.length) {
path =
path.lastIndexOf('/') === path.length - 1
? path + menu[0].childList[0].menuUrl
: path + '/' + menu[0].childList[0].menuUrl;
}
}
resolve(path);
});
})
.catch(error => {
......
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