(type, id, functionID = 'doBrowse')
| 321 | }); |
| 322 | } |
| 323 | function doTask(type, id, functionID = 'doBrowse') { |
| 324 | return new Promise(async (resolve) => { |
| 325 | const options = taskPostUrl(`task/${functionID}`, functionID, `starId=${$.activeId}&id=${id}&type=${type}`) |
| 326 | $.post(options, (err, resp, data) => { |
| 327 | try { |
| 328 | if (err) { |
| 329 | console.log(`${JSON.stringify(err)}`); |
| 330 | console.log(`${$.name} API请求失败,请检查网路重试`); |
| 331 | } else { |
| 332 | console.log(`doBrowse做任务结果:${data}`); |
| 333 | data = JSON.parse(data); |
| 334 | } |
| 335 | } catch (e) { |
| 336 | $.logErr(e, resp); |
| 337 | } finally { |
| 338 | resolve(data); |
| 339 | } |
| 340 | }); |
| 341 | }); |
| 342 | } |
| 343 | function getBrowsePrize(browseId) { |
| 344 | return new Promise(async (resolve) => { |
| 345 | const options = taskPostUrl('task/getBrowsePrize', 'getBrowsePrize', `starId=${$.activeId}&browseId=${browseId}`) |
no test coverage detected