fix bugs
This commit is contained in:
+1
-10
@@ -2,7 +2,6 @@ import { computed, watch } from 'vue'
|
||||
import router from '@/router'
|
||||
import { authenticateWithFingerprint, getToken, isIphone, removeToken } from '@/utils'
|
||||
import { useUserStore } from '@/store/userStore'
|
||||
import { useWalletStore } from '@/store/walletStore'
|
||||
import type { NavigationGuardNext, RouteLocationNormalized } from 'vue-router'
|
||||
import { useAuthStore } from '@/store/useAuthStore'
|
||||
import {
|
||||
@@ -16,7 +15,6 @@ import {
|
||||
|
||||
export function setupRouterGuards() {
|
||||
const userStore = useUserStore()
|
||||
const walletStore = useWalletStore()
|
||||
const authStore = useAuthStore()
|
||||
|
||||
const isApple: boolean = isIphone()
|
||||
@@ -29,16 +27,9 @@ export function setupRouterGuards() {
|
||||
return
|
||||
}
|
||||
|
||||
const tasks: Promise<unknown>[] = [
|
||||
walletStore.getLimitedPrice(),
|
||||
walletStore.getLimitedBuyGold(),
|
||||
]
|
||||
|
||||
if (!userStore.userInfo) {
|
||||
tasks.push(userStore.getMyInfo())
|
||||
await userStore.getMyInfo()
|
||||
}
|
||||
|
||||
await Promise.all(tasks)
|
||||
}
|
||||
|
||||
function goToLogin(to: RouteLocationNormalized, next: NavigationGuardNext) {
|
||||
|
||||
Reference in New Issue
Block a user