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

Function doTask

activity/jd_super_box.js:189–223  ·  view source on GitHub ↗
(taskId,taskType,itemId)

Source from the content-addressed store, hash-verified

187 })
188}
189function doTask(taskId,taskType,itemId) {
190 let body = {
191 "taskId":taskId,
192 "taskType":taskType,
193 "channel":4,
194 "itemId":itemId,
195 "linkId":"xrfyA3nByKnAd7qxzmURNQ",
196 "encryptPin":""
197 }
198 return new Promise(resolve => {
199 $.post(taskPostUrl('apDoTask',body), async (err, resp, data) => {
200 try {
201 if (err) {
202 console.log(`${JSON.stringify(err)}`)
203 console.log(`${$.name} API请求失败,请检查网路重试`)
204 } else {
205 if (safeGet(data)) {
206 data = JSON.parse(data);
207
208 if (data.success) {
209 console.log(`任务完成成功`)
210 } else {
211 $.canDone = false
212 console.log(`任务完成失败`)
213 }
214 }
215 }
216 } catch (e) {
217 $.logErr(e, resp)
218 } finally {
219 resolve();
220 }
221 })
222 })
223}
224function drawInfo(share=true) {
225 let body = {"taskId":"","linkId":"xrfyA3nByKnAd7qxzmURNQ","encryptPin":""}
226 return new Promise(resolve => {

Callers 1

getTaskDetailFunction · 0.70

Calls 5

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

Tested by

no test coverage detected