diff --git a/utils/dashou-profile.js b/utils/dashou-profile.js index 39043a3..938f57f 100644 --- a/utils/dashou-profile.js +++ b/utils/dashou-profile.js @@ -23,9 +23,14 @@ export async function refreshDashouMembership(app) { return app.globalData.clumber || []; } -/** 用户是否持有某会员类型(与抢单卡片判断一致) */ +/** 用户是否持有某会员类型(与抢单卡片判断一致;支持总会员 covers) */ export function userHasHuiyuan(huiyuanList, huiyuanId) { if (!huiyuanId) return true; const list = huiyuanList || []; - return list.some((h) => String(h.huiyuanid) === String(huiyuanId)); + const req = String(huiyuanId); + return list.some((h) => { + if (String(h.huiyuanid) === req) return true; + const covers = h.included_huiyuan_ids || h.covers || []; + return Array.isArray(covers) && covers.some((id) => String(id) === req); + }); }