add promise
This commit is contained in:
parent
faea4d8bf6
commit
523a9b3de3
|
@ -24,6 +24,7 @@ const permission = {
|
||||||
actions: {
|
actions: {
|
||||||
// s
|
// s
|
||||||
GenerateRoutes({ commit }, data) {
|
GenerateRoutes({ commit }, data) {
|
||||||
|
return new Promise(resolve => {
|
||||||
const { roles } = data;
|
const { roles } = data;
|
||||||
const accessedRouters = asyncRouterMap.filter(v => {
|
const accessedRouters = asyncRouterMap.filter(v => {
|
||||||
if (roles.indexOf('admin') >= 0) return true;
|
if (roles.indexOf('admin') >= 0) return true;
|
||||||
|
@ -43,6 +44,8 @@ const permission = {
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
commit('SET_ROUTERS', accessedRouters);
|
commit('SET_ROUTERS', accessedRouters);
|
||||||
|
resolve();
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue