| 96 | } |
| 97 | |
| 98 | function 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 | |
| 122 | function GetAuth(body, data) { |
| 123 | if (body.ticket && body.uid) { |