MCPcopy Index your code
hub / github.com/smallfawn/QLScriptPublic / queryUser

Method queryUser

wxapp/txdt.js:225–255  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

223 }
224
225 async queryUser() {
226 const user = this.loginInfo;
227 const body = {
228 seqid: uuid(),
229 app_id: APP.appid,
230 userId: user.user_id,
231 openId: user.openid,
232 source: "mini-tencentmap",
233 };
234 const { status, data } = await request({
235 method: "POST",
236 url: `${MINI_LOGIN_BASE}/minLogin/v2/getUserInfo`,
237 headers: {
238 "content-type": "application/json",
239 ...loginSign({
240 appId: APP.appid,
241 sessionId: user.session_id,
242 userId: user.user_id,
243 openId: user.openid,
244 postBody: body,
245 }),
246 },
247 data: body,
248 });
249 if (status !== 200 || Number(data?.err_code) !== 0) {
250 $.log(`用户信息:查询失败 HTTP ${status}: ${short(data)}`);
251 return;
252 }
253 this.userInfo = data || {};
254 $.log(`用户信息:${data.nickname || "微信用户"},userId=${data.userid || user.user_id}`);
255 }
256
257 async mapApi(apiPath, data) {
258 const { status, data: body } = await request({

Callers 1

runMethod · 0.95

Calls 5

loginSignFunction · 0.85
uuidFunction · 0.70
requestFunction · 0.70
shortFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected