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

Function doTask

jd_nzmh.js:159–181  ·  view source on GitHub ↗
(taskId)

Source from the content-addressed store, hash-verified

157}
158
159function doTask(taskId) {
160 let body = `task_bless=10&taskid=${taskId}`
161 return new Promise(resolve => {
162 $.get(taskUrl('completeTask', body), async (err, resp, data) => {
163 try {
164 if (err) {
165 console.log(`${err},${jsonParse(resp.body)['message']}`)
166 console.log(`${$.name} API请求失败,请检查网路重试`)
167 } else {
168 data = JSON.parse(data.match(/query\((.*)\n/)[1])
169 if (data.data.complete_task_list.includes(taskId)) {
170 console.log(`任务完成成功,当前幸运值${data.data.curbless}`)
171 $.userInfo.bless = data.data.curbless
172 }
173 }
174 } catch (e) {
175 $.logErr(e, resp)
176 } finally {
177 resolve(data);
178 }
179 })
180 })
181}
182
183function draw() {
184 return new Promise(resolve => {

Callers 1

getUserInfoFunction · 0.70

Calls 5

taskUrlFunction · 0.70
jsonParseFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected