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

Function doSupport

jd_xtg_help.js:315–341  ·  view source on GitHub ↗
(shareId)

Source from the content-addressed store, hash-verified

313 });
314}
315function doSupport(shareId) {
316 return new Promise(async (resolve) => {
317 const options = taskPostUrl('task/doSupport', 'doSupport', `starId=${$.activeId}&shareId=${shareId}`)
318 $.post(options, (err, resp, data) => {
319 try {
320 if (err) {
321 console.log(`${JSON.stringify(err)}`);
322 console.log(`${$.name} API请求失败,请检查网路重试`);
323 } else {
324 data = JSON.parse(data);
325 if (data && data.code === 200) {
326 if (data['data']['status'] === 6) {
327 console.log('助力成功')
328 }
329 if (data['data']['status'] === 5) $.canHelp = false;
330 if (data['data']['status'] === 4) $.item['max'] = true;
331 }
332 console.log(`助力结果:${JSON.stringify(data)}\n`);
333 }
334 } catch (e) {
335 $.logErr(e, resp);
336 } finally {
337 resolve();
338 }
339 });
340 });
341}
342function TotalBean() {
343 return new Promise(async (resolve) => {
344 const options = {

Callers 1

jd_xtg_help.jsFile · 0.70

Calls 4

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

Tested by

no test coverage detected