Skip to content

Commit 2b956c6

Browse files
committed
add redirect handle
1 parent 125e088 commit 2b956c6

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

router/index.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,15 @@ export const RouterHost = ({
6464
cachedFetchServerSideProps(pathname),
6565
]);
6666
if (currentVersion === version.current) {
67-
setCurrent(
68-
<Shell {...props}>
69-
<module.default {...props?.props} />
70-
</Shell>
71-
);
67+
if (props.redirect) {
68+
navigate(props.redirect);
69+
} else {
70+
setCurrent(
71+
<Shell {...props}>
72+
<module.default {...props?.props} />
73+
</Shell>
74+
);
75+
}
7276
}
7377
})().catch((e) => {
7478
console.log(e);

0 commit comments

Comments
 (0)