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

Function doTask

jd_ms.js:208–230  ·  view source on GitHub ↗
(body)

Source from the content-addressed store, hash-verified

206}
207
208function doTask(body) {
209 body = {...body, "encryptProjectId": $.encryptProjectId, "sourceCode": "wh5", "ext": {}}
210 return new Promise(resolve => {
211 $.post(taskPostUrl('doInteractiveAssignment', body), (err, resp, data) => {
212 try {
213 if (err) {
214 console.log(`${err},${jsonParse(resp.body)['message']}`)
215 console.log(`${$.name} API请求失败,请检查网路重试`)
216 } else {
217 if (safeGet(data)) {
218 data = JSON.parse(data)
219 console.log(data.msg)
220 if(data.msg==='风险等级未通过') $.risk =1
221 }
222 }
223 } catch (e) {
224 $.logErr(e, resp)
225 } finally {
226 resolve(data);
227 }
228 })
229 })
230}
231
232function showMsg() {
233 return new Promise(resolve => {

Callers 1

getTaskListFunction · 0.70

Calls 6

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

Tested by

no test coverage detected