|
|
@ -206,28 +206,21 @@ function cookApiDataItem(item) { |
|
|
|
function n2one(v) { |
|
|
|
let ret = []; |
|
|
|
for (let i = 0; i < v.length; i++) { |
|
|
|
// console.log("xxxxx", v[i]);
|
|
|
|
ret.push(v[i]); |
|
|
|
if (Array.isArray(v[i].children) && v[i].children.length > 0) { |
|
|
|
ret.push(...n2one(v[i].children)); |
|
|
|
} |
|
|
|
} |
|
|
|
// console.log("aaaa", ret);
|
|
|
|
return ret; |
|
|
|
} |
|
|
|
let allChildrenUrl = n2one(item.children) |
|
|
|
.filter((i) => i.url != "" && i.showFlag == 1) |
|
|
|
.map((i) => i.url); |
|
|
|
// console.log("))))))))))))", allChildrenUrl);
|
|
|
|
if (item.children.length > 0) { |
|
|
|
if (item.url == "" || !allChildrenUrl.find((i) => i.url == item.url)) { |
|
|
|
item.url = allChildrenUrl[0]; |
|
|
|
} |
|
|
|
} |
|
|
|
// item.children.forEach((item) => {
|
|
|
|
// item.color = "#f00";
|
|
|
|
// return item;
|
|
|
|
// });
|
|
|
|
return item; |
|
|
|
} |
|
|
|
// 把按钮都化为页面内部的权限
|
|
|
@ -998,7 +991,6 @@ router.beforeEach((to, from, next) => { |
|
|
|
return null; |
|
|
|
} |
|
|
|
const match = location.href.match(/[?&]ticket=([^&#]+)/); |
|
|
|
localStorage.setItem('ticket',match[1]) |
|
|
|
if (match && to.name == 'login') { |
|
|
|
http.get(`/auth/xiaZhuangLogin/dealUserInfo?ticket=${match[1]}`) |
|
|
|
.then(({ data: res }) => { |
|
|
@ -1007,9 +999,6 @@ router.beforeEach((to, from, next) => { |
|
|
|
name: 'home' |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
console.log("未找到 ticket 参数"); |
|
|
|
} |
|
|
|
|
|
|
|
if (to.name === "caiji") { |
|
|
@ -1035,13 +1024,10 @@ router.beforeEach((to, from, next) => { |
|
|
|
return next(); |
|
|
|
} |
|
|
|
const customerId = localStorage.getItem("customerId"); |
|
|
|
console.log("customerId:", customerId); |
|
|
|
http |
|
|
|
.get("gov/access/menu/navDigitalCommunityNew?tableName=data_menu") |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code == 10005 || res.code == 10006 || res.code == 10007) { |
|
|
|
// 10005 token为空 10006登陆超时 10007别处登录
|
|
|
|
console.log("登录失效"); |
|
|
|
message({ |
|
|
|
message: res.msg || "未知错误", |
|
|
|
type: "error", |
|
|
@ -1060,7 +1046,6 @@ router.beforeEach((to, from, next) => { |
|
|
|
}); |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.log(err); |
|
|
|
next({ |
|
|
|
name: "login", |
|
|
|
query: { redirect: to.fullPath } |
|
|
@ -1069,18 +1054,12 @@ router.beforeEach((to, from, next) => { |
|
|
|
http |
|
|
|
.get("gov/access/menu/navDigitalCommunityNew") |
|
|
|
.then(({ data: res }) => { |
|
|
|
console.log(res); |
|
|
|
if (res.code == 10005 || res.code == 10006 || res.code == 10007) { |
|
|
|
// 10005 token为空 10006登陆超时 10007别处登录
|
|
|
|
console.log("登录失效"); |
|
|
|
message({ |
|
|
|
message: res.msg || "未知错误", |
|
|
|
type: "error", |
|
|
|
duration: 2 * 1000, |
|
|
|
}); |
|
|
|
|
|
|
|
console.log(to,from,'=============sss'); |
|
|
|
|
|
|
|
return next({ name: "login" }); |
|
|
|
} |
|
|
|
window.SITE_CONFIG["menuList"] = res.data |
|
|
@ -1095,7 +1074,6 @@ router.beforeEach((to, from, next) => { |
|
|
|
}); |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.log(err); |
|
|
|
next({ |
|
|
|
name: "login", |
|
|
|
query: { redirect: to.fullPath } |
|
|
|