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

Function init

jd_cfd.js:1455–1476  ·  view source on GitHub ↗
(function_path, body)

Source from the content-addressed store, hash-verified

1453 await init(`user/SetMark`, body)
1454}
1455async function init(function_path, body) {
1456 return new Promise(async (resolve) => {
1457 $.get(taskUrl(function_path, body), async (err, resp, data) => {
1458 try {
1459 if (err) {
1460 console.log(`${JSON.stringify(err)}`)
1461 console.log(`${$.name} init API请求失败,请检查网路重试`)
1462 } else {
1463 if (function_path == "user/SetMark") opId = 23
1464 if (function_path == "user/guideuser") opId = 27
1465 data = JSON.parse(data.replace(/\n/g, "").match(new RegExp(/jsonpCBK.?\((.*);*\)/))[1]);
1466 contents = `1771|${opId}|${data.iRet}|0|${data.sErrMsg || 0}`
1467 await biz(contents)
1468 }
1469 } catch (e) {
1470 $.logErr(e, resp);
1471 } finally {
1472 resolve();
1473 }
1474 })
1475 })
1476}
1477function biz(contents){
1478 return new Promise(async (resolve) => {
1479 let option = {

Callers 1

noviceTaskFunction · 0.70

Calls 5

bizFunction · 0.85
taskUrlFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected