diff --git a/src/components/common/Sidebar.vue b/src/components/common/Sidebar.vue index 4b2a45a..3cfdbf5 100644 --- a/src/components/common/Sidebar.vue +++ b/src/components/common/Sidebar.vue @@ -134,11 +134,11 @@ export default { }, ], items1: [ - // { - // icon: "el-icon-s-home", - // index: "stritl", - // title: "首页", - // }, + { + icon: "el-icon-s-home", + index: "stritl", + title: "首页", + }, { icon: "el-icon-camera", index: "/realTimeMonitor", @@ -215,11 +215,11 @@ export default { }, ], items2: [ - // { - // icon: "el-icon-s-home", - // index: "stritl", - // title: "首页", - // }, + { + icon: "el-icon-s-home", + index: "stritl", + title: "首页", + }, { icon: "el-icon-camera", index: "/realTimeMonitor", diff --git a/src/router/index.js b/src/router/index.js index 7e7467b..50c18af 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -13,7 +13,7 @@ const routes = [ component: () => import(/* webpackChunkName: "home" */ "../components/common/Home.vue"), meta: { title: "首页" }, - redirect: "/realTimeMonitor", + redirect: "/stritl", children: [ { path: "/stritl", diff --git a/src/views/Login.vue b/src/views/Login.vue index 60ac9e3..fc7f9a5 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -108,7 +108,7 @@ export default { if (res.code == 200) { this.$store.commit("SET_TOKEN", res.data.sessionId); //将token保存在vuex中 this.$store.commit("SET_USERINFO", res.data); //将用户信息保存在vuex中 - this.$router.push("/realTimeMonitor"); + this.$router.push("/stritl"); this.$message({ duration: 1500, diff --git a/src/views/realTimeMonitor/index.vue b/src/views/realTimeMonitor/index.vue index 77eb332..ffa4a87 100644 --- a/src/views/realTimeMonitor/index.vue +++ b/src/views/realTimeMonitor/index.vue @@ -409,14 +409,19 @@ export default { this.onlineNum = res.data.onlineNum; this.totalNum = res.data.totalNum; this.currentData = JSON.parse(localStorage.getItem("currentData")); - + console.log(this.currentData); if (this.lineTreeData[0].list[0].list.length > 0) { - if (Object.keys(this.currentData).length !== 0) { + console.log("diyici"); + if ( + this.currentData !== null && + Object.keys(this.currentData).length !== 0 + ) { + console.log("aaa"); this.currentNodekey = this.currentData.id; this.handleNodeClick(this.currentData); } else { + console.log("diyici"); this.selectData = this.lineTreeData[0]; //第一个选中的数据 - this.currentNodekey = this.lineTreeData[0].id; //第一个数据 this.type = 1; this.newCurrentId = this.lineTreeData[0].id;