|
@@ -124,30 +124,30 @@ const leftMenu = (menuList, {
|
|
|
}
|
|
|
|
|
|
const actions = {
|
|
|
- generateRoutes({
|
|
|
- commit
|
|
|
- }) {
|
|
|
- return new Promise(async resolve => {
|
|
|
- getRoule().then(response => {
|
|
|
- const roles = []
|
|
|
- handleRoles(response.data, roles, '')
|
|
|
- console.log('roles', roles)
|
|
|
- const accessedRoutes = filterAsyncRoutes(constantRoutes, roles)
|
|
|
+// generateRoutes({
|
|
|
+// commit
|
|
|
+// }) {
|
|
|
+// return new Promise(async resolve => {
|
|
|
+// getRoule().then(response => {
|
|
|
+// const roles = []
|
|
|
+// handleRoles(response.data, roles, '')
|
|
|
+// console.log('roles', roles)
|
|
|
+// const accessedRoutes = filterAsyncRoutes(constantRoutes, roles)
|
|
|
|
|
|
- commit('user/SET_ROLES', roles, {
|
|
|
- root: true
|
|
|
- })
|
|
|
- commit('SET_ROUTES', accessedRoutes)
|
|
|
- resolve(accessedRoutes)
|
|
|
- }).catch((err) => {
|
|
|
- console.error('获取角色错误')
|
|
|
- clearStorage()
|
|
|
- resetRouter()
|
|
|
- removeToken()
|
|
|
- window.location.href='https://admin.changyuntong56.com/#/login'
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
+// commit('user/SET_ROLES', roles, {
|
|
|
+// root: true
|
|
|
+// })
|
|
|
+// commit('SET_ROUTES', accessedRoutes)
|
|
|
+// resolve(accessedRoutes)
|
|
|
+// }).catch((err) => {
|
|
|
+// console.error('获取角色错误')
|
|
|
+// clearStorage()
|
|
|
+// resetRouter()
|
|
|
+// removeToken()
|
|
|
+// window.location.href='https://admin.changyuntong56.com/#/login'
|
|
|
+// })
|
|
|
+// })
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
export default {
|