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

Function readShareCode

activity/jd_apple_live.js:270–293  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

268}
269
270function readShareCode() {
271 console.log(`开始`)
272 return new Promise(async resolve => {
273 $.get({url: `http://api.turinglabs.net/api/v1/jd/jdapple/read/${randomCount}/`}, (err, resp, data) => {
274 try {
275 if (err) {
276 console.log(`${JSON.stringify(err)}`)
277 console.log(`${$.name} API请求失败,请检查网路重试`)
278 } else {
279 if (data) {
280 console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
281 data = JSON.parse(data);
282 }
283 }
284 } catch (e) {
285 $.logErr(e, resp)
286 } finally {
287 resolve(data);
288 }
289 })
290 // await $.wait(2000);
291 // resolve()
292 })
293}
294//格式化助力码
295function shareCodesFormat() {
296 return new Promise(async resolve => {

Callers

nothing calls this directly

Calls 3

logMethod · 0.45
getMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected