Browse Source

Merge branch 'dev_shequzhili' of http://git.elinkit.com.cn:7070/r/epmet-oper-gov into dev_shequzhili

shibei_master
jiangyy 3 years ago
parent
commit
7424615aff
  1. 87
      src/router/index.js

87
src/router/index.js

@ -202,26 +202,6 @@ router.beforeEach((to, from, next) => {
const customerId = localStorage.getItem("customerId"); const customerId = localStorage.getItem("customerId");
console.log("customerId:", customerId); console.log("customerId:", customerId);
// http
// .get("/gov/access/menu/nav")
// .then(({ data: res }) => {
// if (res.code !== 0) {
// // Vue.prototype.$message.error(res.msg)
// return next({
// name: "login",
// });
// }
// next({
// ...to,
// replace: true,
// });
// })
// .catch(() => {
// next({
// name: "login",
// });
// });
window.SITE_CONFIG["menuShujuList"] = [ window.SITE_CONFIG["menuShujuList"] = [
// { // {
// url: "/visual/plugin/power/organization", // url: "/visual/plugin/power/organization",
@ -345,8 +325,7 @@ router.beforeEach((to, from, next) => {
// }, // },
], ],
}, },
{ {
icon: "icon-setting", icon: "icon-setting",
id: "2221321fefefaewfa123", id: "2221321fefefaewfa123",
@ -374,25 +353,25 @@ router.beforeEach((to, from, next) => {
id: "5feawfwa111111efwa57", id: "5feawfwa111111efwa57",
}, },
/*{ /*{
url: "/visual/ai/renliu", url: "/visual/ai/renliu",
name: "人流数据", name: "人流数据",
id: "5fwaefwae222112fawef58", id: "5fwaefwae222112fawef58",
}, },
{ {
url: "/visual/ai/cheliu", url: "/visual/ai/cheliu",
name: "车流数据", name: "车流数据",
id: "erawerwecsxefwaw", id: "erawerwecsxefwaw",
}, },
{ {
url: "/visual/ai/shebei", url: "/visual/ai/shebei",
name: "设备数据", name: "设备数据",
id: "zfzffewaf", id: "zfzffewaf",
}, },
{ {
url: "/visual/ai/gongdan", url: "/visual/ai/gongdan",
name: "工单数据", name: "工单数据",
id: "fewafwafewaefddd", id: "fewafwafewaefddd",
},*/ },*/
{ {
// url: "/visual/ai/yujing", // url: "/visual/ai/yujing",
url: "https://test-rxs-job.elinkservice.cn/haiqin-ai/aisecurity.html#/data-analysis", url: "https://test-rxs-job.elinkservice.cn/haiqin-ai/aisecurity.html#/data-analysis",
@ -404,6 +383,32 @@ router.beforeEach((to, from, next) => {
]; ];
fnAddDynamicMenuRoutes2(window.SITE_CONFIG["menuShujuList"]); fnAddDynamicMenuRoutes2(window.SITE_CONFIG["menuShujuList"]);
http
.get("/gov/access/menu/nav?tableName=data_menu")
.then(({ data: res }) => {
if (res.code == 10005 || res.code == 10006 || res.code == 10007) {
// 10005 token为空 10006登陆超时 10007别处登录
console.log("登录失效");
Vue.prototype.$message.error(res.msg);
return next({
name: "login",
});
}
// window.SITE_CONFIG["menuShujuList"] = res.data;
// fnAddDynamicMenuRoutes2(window.SITE_CONFIG["menuShujuList"]);
next({
...to,
replace: true,
});
})
.catch(() => {
next({
name: "login",
});
});
http http
.get("/gov/access/menu/nav") .get("/gov/access/menu/nav")
.then(({ data: res }) => { .then(({ data: res }) => {

Loading…
Cancel
Save