|
|
|
@ -70,14 +70,9 @@ router.beforeEach((to, from, next) => {
|
|
|
|
|
document.title = `${to.meta.title} | 视频监控可视化平台`;
|
|
|
|
|
const role = localStorage.getItem("userName");
|
|
|
|
|
const token = localStorage.getItem("token");
|
|
|
|
|
if (!role && to.path !== "/login") {
|
|
|
|
|
if (!token && to.path !== "/login") {
|
|
|
|
|
alert("1111111111");
|
|
|
|
|
next("/login");
|
|
|
|
|
} else if (to.meta.permission) {
|
|
|
|
|
console.log(to.meta.permission);
|
|
|
|
|
console.log(role);
|
|
|
|
|
// 如果是管理员权限则可进入,这里只是简单的模拟管理员权限而已
|
|
|
|
|
// role === "xytest" ? next() : next("/403");
|
|
|
|
|
next()
|
|
|
|
|
} else {
|
|
|
|
|
next();
|
|
|
|
|
}
|
|
|
|
|