Skip to content

Commit e2a2e9d

Browse files
committed
feat(router): adds base path to history when restoring last route
1 parent 5957f89 commit e2a2e9d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/router/create-router.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ export const createRouter = ({ baseName = '', baseUrl = import.meta.env.BASE_URL
6666

6767
restoreLastRoute().then(async _route => {
6868
const isNotLogin = _route?.name && _route?.name !== Route.Login;
69-
await router.push(isNotLogin ? _route : { name: Route.Calendar });
69+
if (!isNotLogin) await router.push({ name: Route.Calendar });
70+
else {
71+
if (_route.meta.base) await router.push(_route.meta.base);
72+
await router.push(_route);
73+
}
7074
});
7175

7276
return router;

0 commit comments

Comments
 (0)