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

Function acceptTask

activity/jd_watch.js:256–280  ·  view source on GitHub ↗
(body)

Source from the content-addressed store, hash-verified

254}
255// 开始看
256function acceptTask(body) {
257 return new Promise(resolve => {
258 $.post(taskPostUrl("discAcceptTask", body), async (err, resp, data) => {
259 try {
260 if (err) {
261 console.log(`${JSON.stringify(err)}`)
262 console.log(`${$.name} API请求失败,请检查网路重试`)
263 } else {
264 if (safeGet(data)) {
265 data = JSON.parse(data);
266 if(data.success){
267 // console.log('浏览开始请求成功')
268 }else{
269 // console.log(`${data.message}`)
270 }
271 }
272 }
273 } catch (e) {
274 $.logErr(e, resp)
275 } finally {
276 resolve(data);
277 }
278 })
279 })
280}
281// 完成看
282function doTask(body) {
283 return new Promise(resolve => {

Callers 1

jdHealthFunction · 0.85

Calls 5

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

Tested by

no test coverage detected