修改用户授权调用位置和逻辑
This commit is contained in:
@@ -10,6 +10,7 @@ import * as LoginService from "@/services/loginService";
|
||||
import { getCurrentLocation } from "@/utils/locationUtils";
|
||||
import { useUserInfo, useUserActions } from "@/store/userStore";
|
||||
import { useGlobalState } from "@/store/global";
|
||||
import { waitForAuthInit } from "@/utils/authInit";
|
||||
import { requireLoginWithPhone } from "@/utils/helper";
|
||||
import GameTags from "./components/GameTags";
|
||||
import Carousel from "./components/Carousel";
|
||||
@@ -46,8 +47,14 @@ function Index() {
|
||||
const commentRef = useRef();
|
||||
|
||||
useEffect(() => {
|
||||
updateLocation();
|
||||
fetchUserInfo();
|
||||
const init = async () => {
|
||||
updateLocation();
|
||||
// 先等待静默登录完成
|
||||
await waitForAuthInit();
|
||||
// 然后再获取用户信息
|
||||
await fetchUserInfo();
|
||||
};
|
||||
init();
|
||||
}, []);
|
||||
|
||||
useDidShow(() => {
|
||||
|
||||
Reference in New Issue
Block a user