(type, id, functionID = 'doBrowse')
| 269 | }); |
| 270 | } |
| 271 | function doTask(type, id, functionID = 'doBrowse') { |
| 272 | return new Promise(async (resolve) => { |
| 273 | const options = taskPostUrl(`task/${functionID}`, functionID, `starId=${$.activeId}&id=${id}&type=${type}`) |
| 274 | $.post(options, (err, resp, data) => { |
| 275 | try { |
| 276 | if (err) { |
| 277 | console.log(`${JSON.stringify(err)}`); |
| 278 | console.log(`${$.name} API请求失败,请检查网路重试`); |
| 279 | } else { |
| 280 | console.log(`doBrowse做任务结果:${data}`); |
| 281 | data = JSON.parse(data); |
| 282 | } |
| 283 | } catch (e) { |
| 284 | $.logErr(e, resp); |
| 285 | } finally { |
| 286 | resolve(data); |
| 287 | } |
| 288 | }); |
| 289 | }); |
| 290 | } |
| 291 | function getBrowsePrize(browseId) { |
| 292 | return new Promise(async (resolve) => { |
| 293 | const options = taskPostUrl('task/getBrowsePrize', 'getBrowsePrize', `starId=${$.activeId}&browseId=${browseId}`) |
no test coverage detected