's'
This commit is contained in:
@@ -639,7 +639,7 @@ export default function HomeClient() {
|
||||
if (nick) setWechatNick(nick);
|
||||
if (avatar) setWechatAvatar(avatar);
|
||||
void syncWechatProfile();
|
||||
}, [syncWechatProfile]);
|
||||
}, [syncWechatProfile, paidType, userEmail]);
|
||||
|
||||
useEffect(() => {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
@@ -735,6 +735,27 @@ export default function HomeClient() {
|
||||
}
|
||||
}
|
||||
|
||||
// 无匿名 userId 时,若存在真实 wechat userid,也要尝试直接按该 ID 查 VIP
|
||||
// 场景:该 userid 本身就是支付链路 user_id,或者已在后端可关联到 VIP
|
||||
if (!anonymousCandidate && wechatUserId) {
|
||||
const recoveredByWechatUserId = await checkPaymentFromPB(wechatUserId);
|
||||
if (recoveredByWechatUserId) {
|
||||
setStorage("userId", wechatUserId);
|
||||
const name =
|
||||
getStorage("wechatNick") ||
|
||||
getStorage("userEmail") ||
|
||||
getStorage("userName") ||
|
||||
wechatUserId;
|
||||
setUserName(name);
|
||||
setUserEmail(
|
||||
(getStorage("userEmail") || "").includes("@")
|
||||
? getStorage("userEmail")
|
||||
: null
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
await getOrCreateUserId();
|
||||
|
||||
const afterLocalType = getStorage("paidType");
|
||||
|
||||
Reference in New Issue
Block a user