fix: some
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 7m3s

This commit is contained in:
luo
2026-09-18 10:31:14 +08:00
parent ac541b17af
commit 5e7f5eaba4
19 changed files with 463 additions and 128 deletions

View File

@@ -104,12 +104,35 @@ class StorageCompatibilityManager {
return location.href.includes(RoutesAlias.Login)
}
/**
* 检查当前是否处于免登录页面
*/
private isOnPublicPage(): boolean {
if (this.isOnLoginPage()) return true
const route = router.currentRoute.value
if (route?.meta?.noLogin) return true
// 兜底:初始导航可能尚未完成,按地址判断免登录路由
const hashPath = location.hash.replace(/^#/, '').split('?')[0]
const pathName = location.pathname.split('?')[0]
return router.getRoutes().some((record) => {
if (!record.meta?.noLogin) return false
return (
hashPath === record.path ||
hashPath.startsWith(`${record.path}/`) ||
pathName === record.path ||
pathName.startsWith(`${record.path}/`)
)
})
}
/**
* 验证存储数据完整性
*/
validateStorageData(): boolean {
// 如果在登录页面,跳过验证
if (this.isOnLoginPage()) {
// 如果在登录页或免登录页,跳过验证
if (this.isOnPublicPage()) {
return true
}