Commit 0d90e068 authored by wxk's avatar wxk

bug-fix

parent 03cc210b
......@@ -32,13 +32,19 @@
export default {
data(){
return{
platInfo: JSON.parse(sessionStorage.getItem('platInfo')),
platInfo: [],
active: ''
}
},
created() {
Bus.$on('getPlatInfo', val =>{
this.platInfo = val;
})
this.active = this.$route.params.name || this.$route.path;
},
beforeDestroy() {
Bus.$off('getPlatInfo');
},
methods: {
navClick(index) {
this.active = index;
......
......@@ -51,10 +51,6 @@ export default new Router({
require(['../views/RobotDetails.vue'],resolve);
},
},
{
path: 'account',
redirect:'/monitor/account',
}
]
}
]
......
......@@ -17,6 +17,8 @@
import NavLeft from '../components/navLeft'
import axios from 'axios';
import ApiConfig from "../config/api-config";
import Bus from '../assets/js/bus'
export default {
data() {
return {
......@@ -41,6 +43,7 @@
axios.post(ApiConfig.GetPlatformInfo).then( res =>{
if (res.data.code === 200) {
this.platInfo = res.data.data;
Bus.$emit('getPlatInfo', this.platInfo);
sessionStorage.setItem('platInfo', JSON.stringify(this.platInfo))
// console.log(this.platInfo)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment