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

Function getUserInfo

jd_jdzz.js:132–156  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

130}
131
132function getUserInfo() {
133 return new Promise(resolve => {
134 $.get(taskUrl("interactIndex"), async (err, resp, data) => {
135 try {
136 if (err) {
137 console.log(`${JSON.stringify(err)}`)
138 console.log(`${$.name} API请求失败,请检查网路重试`)
139 } else {
140 if (safeGet(data)) {
141 data = JSON.parse(data);
142 if (data.data.shareTaskRes) {
143 console.log(`\n【京东账号${$.index}(${$.nickName || $.UserName})的${$.name}好友互助码】${data.data.shareTaskRes.itemId}\n`);
144 } else {
145 console.log(`\n\n已满5人助力或助力功能已下线,故暂时无${$.name}好友助力码\n\n`)
146 }
147 }
148 }
149 } catch (e) {
150 $.logErr(e, resp)
151 } finally {
152 resolve(data);
153 }
154 })
155 })
156}
157
158function getTaskList(flag = false) {
159 return new Promise(resolve => {

Callers 1

jdWishFunction · 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