diff --git a/src/views/index.vue b/src/views/index.vue index 9fb8756..0748ca7 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -88,6 +88,7 @@ export default { userInfo: null, loading: true,//页面加载 IDTimer: null, + deviceId:'', } }, watch: { @@ -100,6 +101,7 @@ export default { this.getTime() var router = this.$route.query if (router.token && router.userid) { + this.deviceId=router.deviceId?router.deviceId:'' localStorage.setItem('token', router.token) this.api.getUser({ userId: router.userid }).then(res => { @@ -166,6 +168,10 @@ export default { this.leftList[1].list = [] this.leftList[2].list = [] this.$store.state.equipmentList.forEach((el, index) => { + //链接中的deviceId + if(this.deviceId&&this.deviceId==el.deviceId){ + this.$store.state.equipmentIndex = index+1 + } if (el.deviceName == 1) { this.leftList.forEach((el1, index1) => { if (el1.name == '施肥机') {