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

Function helpFriend

jd_crazy_joy.js:373–400  ·  view source on GitHub ↗
(code)

Source from the content-addressed store, hash-verified

371}
372
373function helpFriend(code) {
374 let body = {"paramData": {"inviter": code}}
375 return new Promise(async resolve => {
376 $.get(taskUrl('crazyJoy_task_recordAssist', JSON.stringify(body)), async (err, resp, data) => {
377 try {
378 if (err) {
379 console.log(`${JSON.stringify(err)}`)
380 console.log(`${$.name} API请求失败,请检查网路重试`)
381 } else {
382 if (safeGet(data)) {
383 data = JSON.parse(data);
384 if (data['resultCode'] ==='0') {
385 console.log(`助力结果:${JSON.stringify(data)}`);
386 } else if (data['resultCode'] === '2000402') {
387 console.log(data.resultTips)
388 } else {
389 console.log(`助力异常:${JSON.stringify(data)}`);
390 }
391 }
392 }
393 } catch (e) {
394 $.logErr(e, resp)
395 } finally {
396 resolve();
397 }
398 })
399 })
400}
401
402function getUserBean() {
403 return new Promise(async resolve => {

Callers 1

helpFriendsFunction · 0.70

Calls 5

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

Tested by

no test coverage detected