(shareId)
| 313 | }); |
| 314 | } |
| 315 | function 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 | } |
| 342 | function TotalBean() { |
| 343 | return new Promise(async (resolve) => { |
| 344 | const options = { |
no test coverage detected