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

Function Sign

jd_sign_graphics.js:104–141  ·  view source on GitHub ↗
(i)

Source from the content-addressed store, hash-verified

102}
103
104function Sign(i) {
105 return new Promise(resolve => {
106 $.post(tasPostkUrl(turnTableId[i].id), (err, resp, data) => {
107 try {
108 if (err) {
109 console.log(`\n${turnTableId[i].name} 签到: API查询请求失败 ‼️‼️`)
110 throw new Error(err);
111 } else {
112 if (data) {
113 // console.log(data)
114 data = JSON.parse(data);
115 if (data.success && data.data) {
116 data = data.data
117 if (Number(data.jdBeanQuantity) > 0) beanNum += Number(data.jdBeanQuantity)
118 signFlag = true;
119 console.log(`${turnTableId[i].name} 签到成功:获得 ${Number(data.jdBeanQuantity)}京豆`)
120 } else {
121 if (data.errorMessage) {
122 if(data.errorMessage.indexOf('已签到') > -1 || data.errorMessage.indexOf('今天已经签到') > -1){
123 signFlag = true;
124 }
125 console.log(`${turnTableId[i].name} ${data.errorMessage}`)
126 } else {
127 console.log(`${turnTableId[i].name} ${JSON.stringify(data)}`)
128 }
129 }
130 } else {
131 console.log(`京豆api返回数据为空,请检查自身原因`)
132 }
133 }
134 } catch (e) {
135 $.logErr(e, resp);
136 } finally {
137 resolve(data);
138 }
139 })
140 })
141}
142function Login(i) {
143 return new Promise(resolve => {
144 $.get(taskUrl(turnTableId[i].id), async (err, resp, data) => {

Callers 1

LoginFunction · 0.85

Calls 4

tasPostkUrlFunction · 0.85
postMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected