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

Function userSignIn

jd_kd.js:86–116  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

84 })
85}
86function userSignIn() {
87 return new Promise(resolve => {
88 $.post(taskUrl(), (err, resp, data) => {
89 try {
90 if (err) {
91 console.log(`${JSON.stringify(err)}`)
92 console.log(resp)
93 console.log(`${$.name} API请求失败,请检查网路重试`)
94 } else {
95 if (safeGet(data)) {
96 data = JSON.parse(data);
97 if (data.code === 1) {
98 console.log(`今日签到成功,获得${data.content[0].title}`)
99 message += `京东账号${$.index}${$.nickName}\n今日签到成功,获得${data.content[0].title} 🐶\n`;
100 allMsg += message;
101 } else if (data.code === -1) {
102 console.log(`今日已签到`)
103 // message += `【签到】失败,今日已签到`;
104 } else {
105 console.log(`异常:${JSON.stringify(data)}`)
106 }
107 }
108 }
109 } catch (e) {
110 $.logErr(e, resp)
111 } finally {
112 resolve();
113 }
114 })
115 })
116}
117function taskUrl() {
118 return {
119 url: `https://lop-proxy.jd.com/jiFenApi/signInAndGetReward`,

Callers 1

jd_kd.jsFile · 0.70

Calls 5

taskUrlFunction · 0.70
safeGetFunction · 0.70
postMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected