fix: 解决登陆页刷新跳转的问题 (#4014)

Refs #3739
This commit is contained in:
ssongliu 2024-02-28 17:06:15 +08:00 committed by GitHub
parent c13e2a36cc
commit 66a451fc1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,6 +13,14 @@ router.beforeEach((to, from, next) => {
axiosCanceler.removeAllPending();
const globalStore = GlobalStore();
if (to.name === 'home' && !globalStore.isLogin) {
next({
name: 'entrance',
params: { code: globalStore.entrance },
});
NProgress.done();
return;
}
if (to.name === 'entrance' && globalStore.isLogin) {
if (to.params.code === globalStore.entrance) {
next({