|
@@ -96,8 +96,46 @@ router.beforeEach((to, from, next) => {
|
|
|
let menuList = window.sessionStorage.getItem('SC_listMuen');
|
|
|
let newAr = [];
|
|
|
|
|
|
+ window.sessionStorage.removeItem('czc_per');
|
|
|
+
|
|
|
if (!!window.sessionStorage.getItem('czc_per')) {
|
|
|
store.commit('setPermissionList', JSON.parse(window.sessionStorage.getItem('czc_per')));
|
|
|
+ } else {
|
|
|
+ http.get('/czc-user-center/user/findUserMenu', { appId: '1002' }).then(({ status, data, msg }) => {
|
|
|
+ if (0 == status) {
|
|
|
+ let newArs = []; //权限数组
|
|
|
+ let newData = []; //菜单树
|
|
|
+ for (let i = 0; i < data[0].children.length; i++) {
|
|
|
+ if (data[0].children[i].children != null) {
|
|
|
+ for (let k = 0; k < data[0].children[i].children.length; k++) {
|
|
|
+ if (
|
|
|
+ data[0].children[i].children[k].children != null &&
|
|
|
+ data[0].children[i].children[k].name != '统计报表'
|
|
|
+ ) {
|
|
|
+ for (let j = 0; j < data[0].children[i].children[k].children.length; j++) {
|
|
|
+ if (data[0].children[i].children[k].children[j].linkPath.indexOf(':') != -1) {
|
|
|
+ newArs.push(data[0].children[i].children[k].children[j]);
|
|
|
+ // data[0].children[i].children[k].children = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ data[0].children[i].children[k].children = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ store.commit('setPermissionList', newArs);
|
|
|
+ window.sessionStorage.setItem('czc_per', JSON.stringify(newArs));
|
|
|
+ let datas = data[0].children;
|
|
|
+ window.sessionStorage.setItem('SC_listMuen', JSON.stringify(datas));
|
|
|
+ window.sessionStorage.setItem('setThisDetai', JSON.stringify(data[0]));
|
|
|
+ store.commit('setThisDetai', data[0]);
|
|
|
+ funcRouter(newAr, datas, router);
|
|
|
+ next({ ...to, replace: true });
|
|
|
+ } else {
|
|
|
+ data;
|
|
|
+ this.$message.error(msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
if (menuList == null || menuList == undefined) {
|
|
@@ -124,6 +162,7 @@ router.beforeEach((to, from, next) => {
|
|
|
}
|
|
|
}
|
|
|
store.commit('setPermissionList', newArs);
|
|
|
+
|
|
|
window.sessionStorage.setItem('czc_per', JSON.stringify(newArs));
|
|
|
let datas = data[0].children;
|
|
|
window.sessionStorage.setItem('SC_listMuen', JSON.stringify(datas));
|