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

Function spaceEventList

jd_speed.js:178–230  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

176
177// 检查太空特殊事件
178function spaceEventList() {
179 return new Promise((resolve) => {
180 let spaceEvents = [];
181 const body = { "source": "game"};
182 const spaceEventUrl = {
183 url: `${JD_API_HOST}?appid=memberTaskCenter&functionId=spaceEvent_list&body=${escape(JSON.stringify(body))}`,
184 headers: {
185 Referer: 'https://h5.m.jd.com/babelDiy/Zeus/6yCQo2eDJPbyPXrC3eMCtMWZ9ey/index.html',
186 Cookie: cookie
187 }
188 }
189 $.get(spaceEventUrl, async (err, resp, data) => {
190 try {
191 if (err) {
192 console.log("\n京东天天-加速: 查询太空特殊事件请求失败 ‼️‼️")
193 console.log(`${JSON.stringify(err)}`)
194 } else {
195 if (data) {
196 const cc = JSON.parse(data);
197 if (cc.message === "success" && cc.data.length > 0) {
198 for (let item of cc.data) {
199 if (item.status === 1) {
200 for (let j of item.options) {
201 if (j.type === 1) {
202 spaceEvents.push({
203 "id": item.id,
204 "value": j.value
205 })
206 }
207 }
208 }
209 }
210 if (spaceEvents && spaceEvents.length > 0) {
211 console.log("\n天天加速-查询到" + spaceEvents.length + "个太空特殊事件")
212 } else {
213 console.log("\n天天加速-暂无太空特殊事件")
214 }
215 } else {
216 console.log("\n天天加速-查询无太空特殊事件")
217 }
218 } else {
219 console.log(`京豆api返回数据为空,请检查自身原因`)
220 }
221 }
222 } catch (e) {
223 // $.msg("天天加速-查询太空特殊事件" + e.name + "‼️", JSON.stringify(e), e.message)
224 $.logErr(e, resp)
225 } finally {
226 resolve(spaceEvents)
227 }
228 })
229 })
230}
231
232//处理太空特殊事件
233function spaceEventHandleEvent(spaceEventList) {

Callers 1

jDSpeedUpFunction · 0.85

Calls 3

getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected