(shareId)
| 365 | }); |
| 366 | } |
| 367 | function 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 | } |
| 394 | function indexInfo() { |
| 395 | return new Promise(async (resolve) => { |
| 396 | const options = taskPostUrl('index/indexInfo', 'indexInfo', `starId=${$.activeId}&type=null`); |
no test coverage detected