MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / getMemberInfo

Method getMemberInfo

wxapp/ykb_all.js:402–416  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

400 }
401
402 async getMemberInfo() {
403 try {
404 const data = await this.request({ apiPath: "/ykb_huiyuan/api/v1/MemberMine/Info" });
405 const name = data?.Name || data?.NickName || this.customerName || "未知";
406 const phone = data?.Phone ? ` ${maskPhone(data.Phone)}` : "";
407 const assets = await this.getAssets(data);
408 this.summary.member = `${name}${phone}`;
409 this.summary.assets = `代币=${assets.coin} 金币=${assets.goldCoin} 积分=${assets.integral} 彩票=${assets.ticket} 优惠券=${assets.coupon}`;
410 this.log(`会员: ${this.summary.member} ${this.summary.assets}`);
411 } catch (e) {
412 this.summary.member = `查询失败: ${e.message || e}`;
413 this.log(`查询会员信息失败: ${e.message || e}`);
414 if (isAuthError(e)) this.removeCachedToken();
415 }
416 }
417
418 async getAssets(memberInfo = {}) {
419 const assets = {

Callers 1

runMethod · 0.95

Calls 6

requestMethod · 0.95
getAssetsMethod · 0.95
logMethod · 0.95
removeCachedTokenMethod · 0.95
isAuthErrorFunction · 0.85
maskPhoneFunction · 0.70

Tested by

no test coverage detected