Commit 91972a43 by 潘建波

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

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