This commit is contained in:
eric
2026-03-31 14:08:14 -05:00
parent 3590142297
commit c700d7079f

View File

@@ -334,6 +334,7 @@ async def nomadvip_check_vip(user_id: str = ""):
pb = get_pb_client()
linked_user_id = ""
wx_link_email = ""
if not _uid_has_vip(pb, user_id):
# 关键补链:真实 wechat userid 可通过 vip_email_link.anonymous_user_id 关联到会员 user_id
try:
@@ -359,8 +360,10 @@ async def nomadvip_check_vip(user_id: str = ""):
str(wx_link.get("pb_user_id", "")).strip()
or str(wx_link.get("anonymous_user_id", "")).strip()
)
wx_link_email = str(wx_link.get("email", "")).strip().lower()
except Exception:
linked_user_id = ""
wx_link_email = ""
if not linked_user_id or not _uid_has_vip(pb, linked_user_id):
logging.info("[payjsapi] check_vip miss user_id=%s vip=False", user_id)
result = {"vip": False}
@@ -368,6 +371,8 @@ async def nomadvip_check_vip(user_id: str = ""):
return result
email = _get_linked_email_for_user(pb, user_id)
if not email and wx_link_email:
email = wx_link_email
if not email and linked_user_id:
try:
link_rec = pb.collection("vip_email_link").get_list(