MCPcopy Create free account
hub / github.com/ClydeTime/Surge / checkIn

Function checkIn

Script/Task/amap.js:197–230  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

195}
196
197function checkIn() {
198 return new Promise((resove) => {
199 key = getKey();
200 sign = getSign(channel);
201 url = url= 'https://m5.amap.com/ws/car-place/show?' + getQuery(node, adiu,channel, key, sign);
202 body = getShowBody(node, channel, adiu, userId, sign, actID, playID);
203 body = getBody(body, key);
204 headers = getHeaders(sessionid);
205 const rest = {url: url, body: body, headers: headers};
206 $.post(rest, (err, resp, data) => {
207 try {
208 var obj = $.toObj(data);
209 if(obj?.code == '1'){
210 obj?.data?.playMap?.dailySign?.signList.forEach(t => {
211 if(t?.date == $.time('MM月dd日')){
212 signTerm = obj?.data?.playMap?.dailySign?.signTerm;
213 signDay = t.day;
214 isSign = t.isSign;//isSign = 1 为签到过,懒得管了,让它再提交一次吧
215 message += `${t.date} 签到状态:${isSign == 1 ? '✅' : '待签到'}\n`;
216 return isOk = true;//查询结果
217 }
218 })
219 }else{
220 message += `查询:${obj?.message}\n`;
221 return isOk = false;//查询结果
222 }
223 } catch (e) {
224 $.logErr(e,"❌查询:请重新登陆更新Token");
225 } finally {
226 resove()
227 }
228 })
229 })
230}
231function signIn() {
232 return new Promise((resove) => {
233 key = getKey();

Callers 1

amap.jsFile · 0.85

Calls 10

getKeyFunction · 0.85
getSignFunction · 0.85
getQueryFunction · 0.85
getShowBodyFunction · 0.85
getBodyFunction · 0.85
getHeadersFunction · 0.85
postMethod · 0.45
toObjMethod · 0.45
timeMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected