Skip to content

Commit 18c181e

Browse files
connect URL query parameters btw activities
1 parent d6514da commit 18c181e

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/router/index.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import config from '../config';
77

88
Vue.use(Router);
99

10-
export default new Router({
10+
const router = new Router({
1111
routes: [
1212
{
1313
path: '/',
@@ -29,3 +29,23 @@ export default new Router({
2929
},
3030
],
3131
});
32+
33+
router.beforeEach((to, from, next) => {
34+
35+
if ((from.query.auth_token && !to.query.auth_token)
36+
|| (from.query.uid && !to.query.uid)){
37+
if (from.path === to.path) {
38+
next(false);
39+
} else {
40+
next({
41+
path: to.path,
42+
query: from.query,
43+
});
44+
}
45+
} else {
46+
next();
47+
}
48+
49+
})
50+
51+
export default router

0 commit comments

Comments
 (0)