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

Function getUserBean

jd_crazy_joy.js:402–425  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

400}
401
402function getUserBean() {
403 return new Promise(async resolve => {
404 $.get(taskUrl('crazyJoy_user_getJdBeanInfo'), async (err, resp, data) => {
405 try {
406 if (err) {
407 console.log(`${JSON.stringify(err)}`)
408 console.log(`${$.name} API请求失败,请检查网路重试`)
409 } else {
410 if (safeGet(data)) {
411 data = JSON.parse(data);
412 if (data.success && data.data && data.data.totalBeans)
413 $.bean = data.data.totalBeans
414 else
415 console.log(`获取信息失败`)
416 }
417 }
418 } catch (e) {
419 $.logErr(e, resp)
420 } finally {
421 resolve();
422 }
423 })
424 })
425}
426
427function getCoin() {
428 return new Promise(async resolve => {

Callers 1

jdCrazyJoyFunction · 0.70

Calls 5

taskUrlFunction · 0.70
safeGetFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected