feat(web-admin): skip desktop chrome and login page inside mp webview routes.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
5eb7b0b193
commit
c0721786ff
3 files changed
+54
-3
No files matched your search
@@ -28,6 +28,7 @@ import { StorageConfig } from '@/utils/storage/storage-config'
|
||||
import { fetchLogout } from '@/api/auth'
|
||||
import { RoutesAlias } from '@/router/routesAlias'
|
||||
import { resolveSafeRedirectTarget } from '@/utils/router'
|
||||
import { isMpWebviewPath, redirectToMiniLogin } from '@/utils/mp-webview'
|
||||
|
||||
/**
|
||||
* 用户状态管理
|
||||
@@ -160,8 +161,12 @@ export const useUserStore = defineStore(
|
||||
clearPortalHomeActiveModule()
|
||||
// 重置路由状态
|
||||
resetRouterState(500)
|
||||
// 跳转到登录页,携带当前路由作为 redirect 参数
|
||||
const currentRoute = router.currentRoute.value
|
||||
if (isMpWebviewPath(currentRoute.path)) {
|
||||
redirectToMiniLogin()
|
||||
return
|
||||
}
|
||||
// 跳转到登录页,携带当前路由作为 redirect 参数
|
||||
const redirect =
|
||||
currentRoute.path !== RoutesAlias.Login
|
||||
? resolveSafeRedirectTarget(currentRoute.fullPath, '')
|
||||
|
||||
Reference in new issue
Block a user