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

Function doTask

activity/jd_global.js:222–247  ·  view source on GitHub ↗
(body)

Source from the content-addressed store, hash-verified

220}
221
222async function doTask(body) {
223 return new Promise(resolve => {
224 $.get(taskUrl("taskRun", body), async (err, resp, data) => {
225 try {
226 if (err) {
227 console.log(`${JSON.stringify(err)}`)
228 console.log(`${$.name} API请求失败,请检查网路重试`)
229 } else {
230 if (safeGet(data)) {
231 data = JSON.parse(data);
232 if (data['code'] === '0') {
233 console.log(data['result']['message'])
234
235 } else {
236 console.log(JSON.stringify(data))
237 }
238 }
239 }
240 } catch (e) {
241 $.logErr(e, resp)
242 } finally {
243 resolve(data);
244 }
245 })
246 })
247}
248
249async function helpFriend(inviterPin) {
250 return new Promise(resolve => {

Callers 1

getTaskFunction · 0.70

Calls 5

taskUrlFunction · 0.70
safeGetFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected