's'
This commit is contained in:
@@ -290,7 +290,8 @@ export default function HomeClient() {
|
|||||||
: "";
|
: "";
|
||||||
const hasVipFromRelation =
|
const hasVipFromRelation =
|
||||||
relations?.has_vip_by_user_id === true ||
|
relations?.has_vip_by_user_id === true ||
|
||||||
relations?.has_vip_by_pb_user === true;
|
relations?.has_vip_by_pb_user === true ||
|
||||||
|
relations?.has_vip_by_wechat_userid === true;
|
||||||
if (/^user\d+$/.test(linkedAnonymousUserId)) {
|
if (/^user\d+$/.test(linkedAnonymousUserId)) {
|
||||||
setStorage("userId", linkedAnonymousUserId);
|
setStorage("userId", linkedAnonymousUserId);
|
||||||
setStorage("memosAccount", linkedAnonymousUserId);
|
setStorage("memosAccount", linkedAnonymousUserId);
|
||||||
@@ -299,7 +300,7 @@ export default function HomeClient() {
|
|||||||
// 关键修复:若 wechat_profile 已确认关联到 VIP 用户,立即回填关联 user_id 并进入 VIP 态
|
// 关键修复:若 wechat_profile 已确认关联到 VIP 用户,立即回填关联 user_id 并进入 VIP 态
|
||||||
if (hasVipFromRelation) {
|
if (hasVipFromRelation) {
|
||||||
const resolvedVipUserId =
|
const resolvedVipUserId =
|
||||||
linkedPbUserId || relationUserId || linkedAnonymousUserId;
|
linkedPbUserId || relationUserId || linkedAnonymousUserId || wechatUserId;
|
||||||
if (resolvedVipUserId) {
|
if (resolvedVipUserId) {
|
||||||
setStorage("userId", resolvedVipUserId);
|
setStorage("userId", resolvedVipUserId);
|
||||||
if (/^user\d+$/.test(resolvedVipUserId)) {
|
if (/^user\d+$/.test(resolvedVipUserId)) {
|
||||||
@@ -746,6 +747,23 @@ export default function HomeClient() {
|
|||||||
(getStorage("wechatUserId") || "").trim() ||
|
(getStorage("wechatUserId") || "").trim() ||
|
||||||
(getStorage("userid") || "").trim();
|
(getStorage("userid") || "").trim();
|
||||||
let anonymousCandidate = getStoredAnonymousUserId();
|
let anonymousCandidate = getStoredAnonymousUserId();
|
||||||
|
// 参数 userid 是真实微信用户标识时,应优先用它校验 VIP,避免被历史/新生成 userId 干扰
|
||||||
|
if (wechatUserId) {
|
||||||
|
const wechatVip = await checkPaymentFromPB(wechatUserId);
|
||||||
|
if (wechatVip) {
|
||||||
|
setStorage("userId", wechatUserId);
|
||||||
|
savePaidType("vip");
|
||||||
|
const name =
|
||||||
|
getStorage("wechatNick") ||
|
||||||
|
getStorage("userEmail") ||
|
||||||
|
getStorage("userName") ||
|
||||||
|
wechatUserId;
|
||||||
|
saveUserName(name);
|
||||||
|
const mail = (getStorage("userEmail") || "").trim();
|
||||||
|
setUserEmail(mail.includes("@") ? mail : null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!anonymousCandidate && wechatUserId) {
|
if (!anonymousCandidate && wechatUserId) {
|
||||||
const recoveredFromWechat = await recoverAnonymousUserId({
|
const recoveredFromWechat = await recoverAnonymousUserId({
|
||||||
wechatUserId,
|
wechatUserId,
|
||||||
|
|||||||
Reference in New Issue
Block a user