登录优化

master
fanluyan 2 years ago
parent ec3b3d6a1d
commit 20920a0d1d

@ -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();
}
});

@ -70,7 +70,7 @@ export default {
data: function () {
return {
userInfo: {
userName: "xytest",
userName: "admin",
password: "123456",
//verificationCode: "",
},

@ -786,7 +786,7 @@ export default {
}
}
.el-loading-mask {
z-index: 9999;
z-index: 99;
}
.picdropStyle,
.videodropStyle,

Loading…
Cancel
Save