|
@@ -41,20 +41,23 @@ Vue.use(VueDirectiveImagePreviewer, {
|
|
clickMethod: 'doubleClick'
|
|
clickMethod: 'doubleClick'
|
|
})
|
|
})
|
|
|
|
|
|
-//获取纯权限路由数组
|
|
|
|
-let funList = [];
|
|
|
|
-let fun_list = store.state.fun_list;
|
|
|
|
-if (fun_list && fun_list.length > 0) {
|
|
|
|
- fun_list.forEach(function(item) {
|
|
|
|
- item.list.forEach(function(iten) {
|
|
|
|
- funList.push(iten.iconRoute);
|
|
|
|
- if (iten.iconSubRouteList) {
|
|
|
|
- iten.iconSubRouteList.forEach(function(iteb) {
|
|
|
|
- funList.push(iteb)
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+//获取纯权限路由数组,由函数每次获取
|
|
|
|
+function getFunList() {
|
|
|
|
+ let funList = [];
|
|
|
|
+ let fun_list = store.state.fun_list;
|
|
|
|
+ if (fun_list && fun_list.length > 0) {
|
|
|
|
+ fun_list.forEach(function(item) {
|
|
|
|
+ item.list.forEach(function(iten) {
|
|
|
|
+ funList.push(iten.iconRoute);
|
|
|
|
+ if (iten.iconSubRouteList) {
|
|
|
|
+ iten.iconSubRouteList.forEach(function(iteb) {
|
|
|
|
+ funList.push(iteb)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
})
|
|
})
|
|
- })
|
|
|
|
|
|
+ }
|
|
|
|
+ return funList;
|
|
}
|
|
}
|
|
//console.log(funList)
|
|
//console.log(funList)
|
|
|
|
|
|
@@ -70,6 +73,8 @@ router.beforeEach((to, from, next) => {
|
|
if (store.state.person_data) {
|
|
if (store.state.person_data) {
|
|
|
|
|
|
if ((to.meta.form != null && to.meta.form) || (to.meta.mode != null && to.meta.mode)) {
|
|
if ((to.meta.form != null && to.meta.form) || (to.meta.mode != null && to.meta.mode)) {
|
|
|
|
+
|
|
|
|
+ let funList = getFunList();
|
|
//验证
|
|
//验证
|
|
if (funList.indexOf(to.name) > -1) {
|
|
if (funList.indexOf(to.name) > -1) {
|
|
next();
|
|
next();
|