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

Function readShareCode

activity/jd_pubg.js:317–340  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

315 })
316}
317function readShareCode() {
318 console.log(`开始`)
319 return new Promise(async resolve => {
320 $.get({url: `http://api.turinglabs.net/api/v1/jd/jdapple/read/${randomCount}/`}, (err, resp, data) => {
321 try {
322 if (err) {
323 console.log(`${JSON.stringify(err)}`)
324 console.log(`${$.name} API请求失败,请检查网路重试`)
325 } else {
326 if (data) {
327 console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
328 data = JSON.parse(data);
329 }
330 }
331 } catch (e) {
332 $.logErr(e, resp)
333 } finally {
334 resolve(data);
335 }
336 })
337 // await $.wait(2000);
338 // resolve()
339 })
340}
341//格式化助力码
342function shareCodesFormat() {
343 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