|
|
|
@ -46,6 +46,22 @@ Viewer.setDefaults({
|
|
|
|
|
zIndexInline: 9999,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//使用钩子函数对路由进行权限跳转
|
|
|
|
|
router.beforeEach((to, from, next) => {
|
|
|
|
|
document.title = `${to.meta.title} | 视频监控可视化平台`;
|
|
|
|
|
const role = localStorage.getItem("userName");
|
|
|
|
|
const token = localStorage.getItem("token");
|
|
|
|
|
console.log(role, token);
|
|
|
|
|
if (!token && to.path !== "/login") {
|
|
|
|
|
//next("/login");
|
|
|
|
|
next({
|
|
|
|
|
path: "/login",
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
next();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
new Vue({
|
|
|
|
|
router,
|
|
|
|
|
store,
|
|
|
|
@ -65,14 +81,3 @@ Vue.directive("debounce", {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
//使用钩子函数对路由进行权限跳转
|
|
|
|
|
router.beforeEach((to, from, next) => {
|
|
|
|
|
document.title = `${to.meta.title} | 视频监控可视化平台`;
|
|
|
|
|
const role = localStorage.getItem("userName");
|
|
|
|
|
const token = localStorage.getItem("token");
|
|
|
|
|
if (!token && to.path !== "/login") {
|
|
|
|
|
next("/login");
|
|
|
|
|
} else {
|
|
|
|
|
next();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|