【调整】打包配置调整

This commit is contained in:
chenzhihua
2025-07-17 14:02:54 +08:00
parent 260601055f
commit 074f2c5903
78 changed files with 1358 additions and 825 deletions

View File

@@ -16,6 +16,14 @@ const useRouterEach = (router: Router) =>
beforeEach: (to: RouteLocationNormalized, _: RouteLocationNormalized, next: NavigationGuardNext) => {
// 开始加载
loadingBar.start()
// 处理SPA路由回退重定向
const redirectPath = sessionStorage.getItem('redirectPath')
if (redirectPath && to.path === '/') {
sessionStorage.removeItem('redirectPath')
return next(redirectPath)
}
// 判断当前路由是否存在,如果不存在,则跳转到 404
if (!router.hasRoute(to.name as string)) {
if (!to.path.includes('/404')) return next({ path: '/404' })