Feature/task1.0.0 See merge request yanxuan-frontend/shop-pc!61merge-requests/63/merge
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 2.4 KiB |
@ -0,0 +1,15 @@
|
||||
export default ({ app }) => {
|
||||
app.router.beforeEach((to, from, next) => {
|
||||
if (app.store.state.token) {
|
||||
next();
|
||||
return;
|
||||
}
|
||||
|
||||
// 未登录打开个人中心相关页面,跳首页
|
||||
if (/\/account/.test(to.path)) {
|
||||
next("/");
|
||||
return;
|
||||
}
|
||||
next();
|
||||
});
|
||||
};
|
Before Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 763 B |