未验证 提交 ec7efcf0 编写于 作者: Z ZhaoBin 提交者: GitHub

fix(router): reserving `Redirect` after reset (#126)

After logging out and then logging in, click Refresh to display 404.
上级 cbcd9098
......@@ -7,6 +7,7 @@ import { createGuard } from './guard/';
import { basicRoutes } from './routes/';
import { scrollBehavior } from './scrollBehavior';
import { REDIRECT_NAME } from './constant';
export const hashRouter = createWebHashHistory();
......@@ -20,7 +21,7 @@ const router = createRouter({
// reset router
export function resetRouter() {
const resetWhiteNameList = ['Login'];
const resetWhiteNameList = ['Login', REDIRECT_NAME];
router.getRoutes().forEach((route) => {
const { name } = route;
if (name && !resetWhiteNameList.includes(name as string)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册