MCPcopy Create free account
hub / github.com/Moli-X/Resources / doturnover

Function doturnover

Script/Elem/elemSign.js:156–201  ·  view source on GitHub ↗
(count,time)

Source from the content-addressed store, hash-verified

154}
155
156function doturnover(count,time) {
157
158 return new Promise(resolve => {
159 setTimeout(() => {
160
161 try {
162 var endurl = '/sign_in/daily/prize'
163 let body = { "channel": "app", "index": random(0, 3), "longitude": 116.334716796875, "latitude": 59.73897171020508 };
164 url = {
165 url: `https://h5.ele.me/restapi/member/v2/users/`,
166 headers: headerscommon,
167 body: JSON.stringify(body)
168 }
169 if (cookieVal == undefined || cookieVal == "0" || cookieVal == null) {
170 sy.msg(cookieName, "未获取Cookie", '');
171 return;
172 }
173 url.url += userid;
174 url.url += endurl;
175 sy.post(url, (error, response, data) => {
176 var obj = JSON.parse(data);
177 sy.log(count);
178 if (response.status == 200) {
179 turnstr = turnstr + `成功(${count})🎉 `
180 for (var i in obj) {
181 turnresult.push(obj[i]);
182 }
183
184 } else if (response.status == 400) {
185 turnstr = turnstr + `重复(${count})❗ `
186
187 }
188 else {
189 turnstr = turnstr + `未知(${count})❗ `
190 }
191
192
193 resolve('done');
194 })
195 }
196 catch (erre) {
197 resolve('done')
198 }
199 },time)
200 })
201}
202
203function doshare() {
204

Callers 1

signFunction · 0.85

Calls 7

randomFunction · 0.85
stringifyMethod · 0.45
msgMethod · 0.45
postMethod · 0.45
parseMethod · 0.45
logMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected