loading 也需要检查,解决跳转问题
This commit is contained in:
parent
57aa8fc1b2
commit
bf968996b0
2
.env
2
.env
@ -1,5 +1,5 @@
|
||||
# 应用版本号
|
||||
VITE_APP_VERSION=1.1.0
|
||||
VITE_APP_VERSION=1.1.1
|
||||
|
||||
# 构建时间戳(会在构建时自动更新)
|
||||
VITE_BUILD_TIME=""
|
||||
|
||||
@ -388,7 +388,6 @@ class RouteGuard {
|
||||
*/
|
||||
isPublicPage(path) {
|
||||
const publicPages = [
|
||||
'/loading', // 加载页面 - 不需要任何检查
|
||||
PAGES.APPLY, // 申请页面 - 重要:申请页面不需要权限检查
|
||||
PAGES.NOT_APP, // 错误页面 - APP连接失败时的页面
|
||||
'/404', // 404页面
|
||||
|
||||
@ -49,8 +49,7 @@ import { ref, onMounted, onUnmounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { isInApp, connectApplication, parseAccessOrigin, parseHeader, setHttpHeaders } from '../utils/appBridge.js'
|
||||
import { appConnectionManager } from '../utils/appConnectionManager.js'
|
||||
import {getMemberProfile} from '../api/wallet.js'
|
||||
import { setUserInfo } from '../utils/userStore.js'
|
||||
import {getDefaultPage} from "@/utils/permissionManager.js";
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
@ -161,22 +160,7 @@ const waitForLoadingComplete = () => {
|
||||
// 跳转到目标页面
|
||||
const navigateToTargetPage = async () => {
|
||||
try {
|
||||
// 尝试获取用户信息来判断跳转目标
|
||||
const response = await getMemberProfile()
|
||||
|
||||
if (response && response.status && response.body) {
|
||||
// 有团队信息,根据默认设置跳转到主页
|
||||
const memberProfile = response.body
|
||||
if (memberProfile) {
|
||||
setUserInfo(memberProfile, null)
|
||||
router.replace('/host-center')
|
||||
} else {
|
||||
router.replace('/apply')
|
||||
}
|
||||
} else {
|
||||
// 没有团队信息,跳转到申请页面
|
||||
router.replace('/apply')
|
||||
}
|
||||
router.replace(getDefaultPage())
|
||||
} catch (error) {
|
||||
console.error('Failed to get team entry:', error)
|
||||
// 出错时跳转到申请页面
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user