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

Method queryUser

wxapp/nestle.js:206–219  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

204 }
205
206 async queryUser() {
207 const res = await this.api("GET", "member/api/User/GetUserInfo", {}, true);
208 if (Number(res?.errcode) !== 200) {
209 $.log(`用户信息:查询失败 ${short(res)}`);
210 return;
211 }
212 this.userInfo = res.data || {};
213 const user = this.userInfo;
214 const name = firstValue(user.nickname, user.nickName, user.name, user.user_name, "未知");
215 const mobile = maskPhone(firstValue(user.mobile, user.phone, user.tel));
216 const userId = firstValue(user.userid, user.user_id, this.jwt.user_id, "未知");
217 const level = firstValue(user.level_name, user.member_level_name, user.grade_name, user.memberLevelName, "未知");
218 $.log(`用户信息:${name}${mobile ? ` ${mobile}` : ""},会员ID=${userId},等级=${level}`);
219 }
220
221 async queryPoints(prefix = "巢币") {
222 const res = await this.api("POST", "pointsservice/api/Points/getuserbalance", {}, true);

Callers 1

runMethod · 0.95

Calls 5

apiMethod · 0.95
shortFunction · 0.70
firstValueFunction · 0.70
maskPhoneFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected