| 1453 | await init(`user/SetMark`, body) |
| 1454 | } |
| 1455 | async 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 | } |
| 1477 | function biz(contents){ |
| 1478 | return new Promise(async (resolve) => { |
| 1479 | let option = { |