|
|
@@ -55,6 +55,7 @@ import { ApiStatus } from '@/utils/http/status'
|
|
|
import { isHttpError } from '@/utils/http/error'
|
|
|
import { RouteRegistry, MenuProcessor, IframeRouteManager, RoutePermissionValidator } from '../core'
|
|
|
import { refreshMenuBadges } from '@/utils/menu-badge-registry'
|
|
|
+import { isMpWebviewPath } from '@/utils/mp-webview'
|
|
|
|
|
|
// 路由注册器实例
|
|
|
let routeRegistry: RouteRegistry | null = null
|
|
|
@@ -176,6 +177,11 @@ async function handleRouteGuard(
|
|
|
|
|
|
// 3. 处理动态路由注册
|
|
|
if (!routeRegistry?.isRegistered() && userStore.isLogin) {
|
|
|
+ if (isMpWebviewPath(to.path)) {
|
|
|
+ setPageTitle(to)
|
|
|
+ next()
|
|
|
+ return
|
|
|
+ }
|
|
|
// 防止并发请求(快速连续导航场景)
|
|
|
if (routeInitInProgress) {
|
|
|
// 正在初始化中,等待完成后重新导航
|
|
|
@@ -218,8 +224,13 @@ function handleLoginStatus(
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
- // 已登录或访问登录页或静态路由,直接放行
|
|
|
- if (userStore.isLogin || to.path === RoutesAlias.Login || isStaticRoute(to.path)) {
|
|
|
+ // 已登录或访问登录页、静态路由、小程序 WebView 路由,直接放行
|
|
|
+ if (
|
|
|
+ userStore.isLogin ||
|
|
|
+ to.path === RoutesAlias.Login ||
|
|
|
+ isStaticRoute(to.path) ||
|
|
|
+ isMpWebviewPath(to.path)
|
|
|
+ ) {
|
|
|
return true
|
|
|
}
|
|
|
|