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

Function hitGroup

jd_bean_home.js:249–282  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

247}
248
249function hitGroup() {
250 return new Promise(resolve => {
251 const body = {"activeType": 2,};
252 $.get(taskGetUrl('signGroupHit', body), async (err, resp, data) => {
253 try {
254 if (err) {
255 console.log(`${JSON.stringify(err)}`)
256 console.log(`${$.name} API请求失败,请检查网路重试`)
257 } else {
258 if (safeGet(data)) {
259 data = JSON.parse(data);
260 if (data.data.respCode === "SG150") {
261 let {shareCode, groupCode} = data.data.signGroupMain
262 if (shareCode) {
263 $.newShareCodes.push([shareCode, groupCode])
264 console.log('开团成功')
265 console.log(`\n京东账号${$.index} ${$.nickName || $.UserName} 抢京豆邀请码:${shareCode}\n`);
266 await help(shareCode, groupCode, 1)
267 } else {
268 console.log(`为获取到助力码,错误信息${JSON.stringify(data.data)}`)
269 }
270 } else {
271 console.log(`开团失败,错误信息${JSON.stringify(data.data)}`)
272 }
273 }
274 }
275 } catch (e) {
276 $.logErr(e, resp)
277 } finally {
278 resolve();
279 }
280 })
281 })
282}
283
284function help(shareCode, groupCode, isTask = 0) {
285 return new Promise(resolve => {

Callers 1

getUserInfoFunction · 0.85

Calls 6

taskGetUrlFunction · 0.70
safeGetFunction · 0.70
helpFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected