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

Function getPoint

jd_car.js:223–251  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

221}
222
223function getPoint() {
224 return new Promise(resolve => {
225 $.get(taskUrl('v1/user/point'), async (err, resp, data) => {
226 try {
227 if (err) {
228 data = JSON.parse(resp.body)
229 console.log(`${data.error.msg}`)
230 } else {
231 if (safeGet(data)) {
232 data = JSON.parse(data);
233 if (data.status) {
234 if (data.data.remainPoint >= data.data.oncePoint) {
235 console.log(`当前赛点:${data.data.remainPoint}/${data.data.oncePoint},可以兑换京豆,请打开APP兑换`)
236 message += `当前赛点:${data.data.remainPoint}/${data.data.oncePoint},可以兑换京豆,请打开APP兑换\n`
237 }else{
238 console.log(`当前赛点:${data.data.remainPoint}/${data.data.oncePoint}无法兑换京豆`)
239 message += `当前赛点:${data.data.remainPoint}/${data.data.oncePoint},无法兑换京豆\n`
240 }
241 }
242 }
243 }
244 } catch (e) {
245 $.logErr(e, resp)
246 } finally {
247 resolve();
248 }
249 })
250 })
251}
252
253function taskUrl(function_id, body = {}) {
254 return {

Callers 1

jdCarFunction · 0.85

Calls 5

taskUrlFunction · 0.70
safeGetFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected