MCPcopy Create free account
hub / github.com/Semporia/Scripts / getUserInfo

Function getUserInfo

jd_cfd_loop.js:260–319  ·  view source on GitHub ↗
(showInvite = true)

Source from the content-addressed store, hash-verified

258
259// 获取用户信息
260function getUserInfo(showInvite = true) {
261 return new Promise(async (resolve) => {
262 $.get(taskUrl(`user/QueryUserInfo`), (err, resp, data) => {
263 try {
264 if (err) {
265 console.log(`${JSON.stringify(err)}`)
266 console.log(`${$.name} QueryUserInfo API请求失败,请检查网路重试`)
267 } else {
268 data = JSON.parse(data);
269 const {
270 iret,
271 buildInfo = {},
272 ddwRichBalance,
273 ddwCoinBalance,
274 JxUserWelfare,
275 sErrMsg,
276 strMyShareId,
277 strNickName,
278 dwLandLvl,
279 Fund = {}
280 } = data;
281 const dwIsJxNewUser = JxUserWelfare["dwIsJxNewUser"]
282 if (showInvite) {
283 console.log(`\n获取用户信息:${sErrMsg}\n${$.showLog ? data : ""}`);
284 console.log(`\n当前等级:${dwLandLvl},金币:${ddwCoinBalance},财富值:${ddwRichBalance}\n`)
285 }
286 if (showInvite && strMyShareId) {
287 console.log(`财富岛好友互助码每次运行都变化,旧的可继续使用`);
288 console.log(`\n【京东账号${$.index} ${$.UserName} 的${$.name}好友互助码】${strMyShareId}\n\n`);
289 $.shareCodes.push(strMyShareId)
290 }
291 $.info = {
292 ...$.info,
293 buildInfo,
294 ddwRichBalance,
295 ddwCoinBalance,
296 dwIsJxNewUser,
297 strMyShareId,
298 strNickName,
299 dwLandLvl,
300 Fund
301 };
302 resolve({
303 buildInfo,
304 ddwRichBalance,
305 ddwCoinBalance,
306 dwIsJxNewUser,
307 strMyShareId,
308 strNickName,
309 Fund
310 });
311 }
312 } catch (e) {
313 $.logErr(e, resp);
314 } finally {
315 resolve();
316 }
317 });

Callers 1

cfdFunction · 0.70

Calls 4

taskUrlFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected