You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
298 B
16 lines
298 B
3 years ago
|
export default ({ app }) => {
|
||
|
app.router.beforeEach((to, from, next) => {
|
||
|
if (app.store.state.token) {
|
||
|
next();
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
// 未登录打开个人中心相关页面,跳首页
|
||
|
if (/\/account/.test(to.path)) {
|
||
|
next("/");
|
||
|
return;
|
||
|
}
|
||
|
next();
|
||
|
});
|
||
|
};
|