|
|
@@ -421,11 +421,12 @@ router.beforeEach((to, from, next) => {
|
|
|
window.open(url);
|
|
|
return;
|
|
|
}
|
|
|
+ console.log(to);
|
|
|
if (!store.state.userInfo && to.meta.pageType !== Page.Login) {
|
|
|
store
|
|
|
.dispatch('getUserInfo')
|
|
|
.then(() => {
|
|
|
- next();
|
|
|
+ next(backNext(to));
|
|
|
})
|
|
|
.catch(() => {
|
|
|
if (to.meta.pageType != Page.Every) {
|
|
|
@@ -440,14 +441,26 @@ router.beforeEach((to, from, next) => {
|
|
|
next(false);
|
|
|
});
|
|
|
} else {
|
|
|
- next();
|
|
|
+ next(backNext(to));
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
- next();
|
|
|
+ next(backNext(to));
|
|
|
}
|
|
|
});
|
|
|
router.afterEach((to, from) => {
|
|
|
jsapiSign();
|
|
|
});
|
|
|
+
|
|
|
+function backNext(to) {
|
|
|
+ if (to.path === '/collectionDetail') {
|
|
|
+ to.path = '/productDetail';
|
|
|
+ return to;
|
|
|
+ } else if (to.path === '/castingDetail') {
|
|
|
+ to.path = '/creatorDetail';
|
|
|
+ return to;
|
|
|
+ } else {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+}
|
|
|
export default router;
|