Skip to content

Commit

Permalink
路由跳转时保留token参数
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoZuohong committed Sep 27, 2023
1 parent 8449137 commit aa99655
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ui/src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,13 @@ const router = createRouter({
routes
})

router.beforeEach((to, from) => {
if (from.query.token && !to.query.token) {
return {
path: to.path,
query: from.query
}
}
})

export default router

0 comments on commit aa99655

Please sign in to comment.