Commit 91972a43 by 潘建波

修改复制链接后设备列表请求错误

1 parent a1aef303
......@@ -16,6 +16,7 @@ export default {
}
let token = localStorage.getItem("atoken");
if (!token) {
alert('errtoken')
this.$router.push("/login");
}
},
......
......@@ -33,10 +33,11 @@ service.interceptors.request.use(
);
// 添加响应拦截器
service.interceptors.response.use(
response => {
let { data } = response;
return data;
let { data } = response;
return data;
},
error => {
console.log(error);
......
......@@ -8,7 +8,7 @@ export const constantRouterMap = [
path: "/",
name: "首页",
component: resolve => require(["../views/Layout/index.vue"], resolve),
redirect: "/trficcshow",
redirect: "/login",
children: [
{
path: "/trficcshow",
......
......@@ -12,7 +12,6 @@ export default {
}
},
created(){
alert(1)
}
}
</script>
......
......@@ -40,7 +40,7 @@ export default {
return {
full: false,
isCollapse: false,
activemenu: "/",
activemenu: "/indexshow",
topbar:[]
};
},
......@@ -48,7 +48,7 @@ export default {
handleSelect(key, keyPath) {
this.$router.push(key);
localStorage.setItem("curmenu", key);
this.activemenu = key
this.activemenu = key;
},
collapsemenu() {
this.isCollapse = !this.isCollapse;
......@@ -58,21 +58,23 @@ export default {
...mapGetters(["permission_routers"])
},
created() {
let activemenu = localStorage.getItem("curmenu");
// let activemenu = localStorage.getItem("curmenu");
let activemenu = location.href.split('#')[1];
if (activemenu) {
this.activemenu = activemenu;
this.$router.push(activemenu);
} else {
this.$router.push('/');
this.$router.push("/");
this.activemenu = '/';
}
},
watch:{
$route(t, f){
console.log('to',t)
let obj = {
name:f.name,
path:f.path,
icon:f.meta.icon
name:t.name,
path:t.path,
// icon:t.meta.icon
}
this.$emit("setTopBar",obj)
}
......
......@@ -144,7 +144,7 @@ export default {
this.$store
.dispatch("GetMenuRole", res.menu_tree[0].children)
.then(res => {
this.$router.push("/");
this.$router.push("/trficcshow");
});
});
},
......@@ -248,7 +248,7 @@ export default {
},
getDev() {
this.$api.resource.devs().then(res => {
sessionStorage.setItem("dev_unid", res[0].dev_unid);
localStorage.setItem("dev_unid", res[0].dev_unid);
this.getDevsName(res[0].dev_unid);
});
},
......
......@@ -126,7 +126,7 @@
systemTime:'',
syncTime:false,
computerTime:this.$moment().format("YYYY-MM-DD HH:mm:ss"),
dev_unid:sessionStorage.getItem('dev_unid'),
dev_unid:localStorage.getItem('dev_unid'),
device_id:sessionStorage.getItem('device_id'),
serverAdr:''
}
......
......@@ -117,7 +117,7 @@
selectFilename:'',
timeArr:[],
file:null,
dev_unid:sessionStorage.getItem('dev_unid'),
dev_unid:localStorage.getItem('dev_unid'),
device_id:sessionStorage.getItem('device_id'),
}
},
......
......@@ -49,7 +49,7 @@
],
},
user_unid:sessionStorage.getItem('user_unid'),
dev_unid:sessionStorage.getItem('dev_unid'),
dev_unid:localStorage.getItem('dev_unid'),
isGetted:false,
sipSetting:{
sip_username: '', // string
......
......@@ -127,7 +127,7 @@
isLeaf: 'leaf'
},
detailData:[],
dev_unid: sessionStorage.getItem('dev_unid'),
dev_unid: localStorage.getItem('dev_unid'),
resource:{
picture_busy: 0,
picture_free: 0,
......
......@@ -88,7 +88,7 @@
currentIndex: 0,
eventList: JSON.parse(window.localStorage.getItem('安防事件')),
playurl: '',
dev_unid: sessionStorage.getItem('dev_unid'),
dev_unid: localStorage.getItem('dev_unid'),
cameraArr:[],
cameraTree:[],
videoTree:[],
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!