|
@@ -48,15 +48,15 @@ const mutations = {
|
|
|
}
|
|
|
|
|
|
const actions = {
|
|
|
- generateRoutes({ commit }, roles) {
|
|
|
+ generateRoutes({ commit }, userInfo) {
|
|
|
return new Promise(resolve => {
|
|
|
let accessedRoutes
|
|
|
- if (roles.includes('admin')) {
|
|
|
+ if (userInfo.roles.includes('admin')) {
|
|
|
accessedRoutes = asyncRoutes || []
|
|
|
} else {
|
|
|
- accessedRoutes = filterAsyncRoutes(asyncRoutes, roles)
|
|
|
+ accessedRoutes = filterAsyncRoutes(asyncRoutes, userInfo.roles)
|
|
|
}
|
|
|
- getModule({ organizeID: 1 }).then(response => {
|
|
|
+ getModule({ organizeID: userInfo.organizeID }).then(response => {
|
|
|
const modules = response.data[0]
|
|
|
accessedRoutes.forEach(routeItem => {
|
|
|
if (routeItem.name === 'Goods') {
|