MCPcopy Index your code
hub / github.com/NobyDa/Script / Points

Function Points

Ctrip-DailyBonus/Ctrip.js:98–120  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

96}
97
98function Points(key) {
99 const opts = {
100 url: 'https://m.ctrip.com/restapi/soa2/15634/json/getPointsOrderUserInfo',
101 headers: {
102 "Content-Type": "application/json",
103 "User-Agent": 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/21E219 MicroMessenger/8.0.49'
104 },
105 body: JSON.stringify({ needUserInfo: true, head: { auth: key } })
106 };
107 $.debug(`Send points request:`, $.toStr(opts, 'error', null, 1));
108 return $.http.post(opts)
109 .then((resp) => {
110 $.debug(`Receive points request response:`, $.toStr(resp))
111 resp.body = JSON.parse(resp.body?.startsWith('{') && resp.body || '{}');
112 if (resp.body.isLogin) {
113 return `总积分: ${resp.body.availableCredits || 0}`
114 }
115 })
116 .catch((err) => {
117 $.error(`Send points request error:`, err)
118 return `总积分: 查询错误`
119 })
120}
121
122function GetAuth(body, data) {
123 if (body.ticket && body.uid) {

Callers 1

Ctrip.jsFile · 0.85

Calls 5

stringifyMethod · 0.45
debugMethod · 0.45
toStrMethod · 0.45
postMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected