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

Function doSupport

jd_xtg.js:367–393  ·  view source on GitHub ↗
(shareId)

Source from the content-addressed store, hash-verified

365 });
366}
367function doSupport(shareId) {
368 return new Promise(async (resolve) => {
369 const options = taskPostUrl('task/doSupport', 'doSupport', `starId=${$.activeId}&shareId=${shareId}`)
370 $.post(options, (err, resp, data) => {
371 try {
372 if (err) {
373 console.log(`${JSON.stringify(err)}`);
374 console.log(`${$.name} API请求失败,请检查网路重试`);
375 } else {
376 data = JSON.parse(data);
377 if (data && data.code === 200) {
378 if (data['data']['status'] === 6) {
379 console.log('助力成功')
380 }
381 if (data['data']['status'] === 5) $.canHelp = false;
382 if (data['data']['status'] === 4) $.item['max'] = true;
383 }
384 console.log(`助力结果:${JSON.stringify(data)}\n`);
385 }
386 } catch (e) {
387 $.logErr(e, resp);
388 } finally {
389 resolve();
390 }
391 });
392 });
393}
394function indexInfo() {
395 return new Promise(async (resolve) => {
396 const options = taskPostUrl('index/indexInfo', 'indexInfo', `starId=${$.activeId}&type=null`);

Callers 1

jd_xtg.jsFile · 0.70

Calls 4

taskPostUrlFunction · 0.70
postMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected