()
| 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 = { |
no test coverage detected