|
|
@@ -20,7 +20,25 @@ const HbcpreConstKey = {
|
|
|
floatPriceIntaval: 'HbcpreFloatPriceIntaval',
|
|
|
};
|
|
|
|
|
|
-const userAgent = `Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1`;
|
|
|
+const gUserAgent = `Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1`;
|
|
|
+const gCommonHeaders = {
|
|
|
+ 'If-Modified-Since' : `0`,
|
|
|
+ 'Connection' : `keep-alive`,
|
|
|
+ 'Accept-Encoding' : `gzip, deflate, br`,
|
|
|
+ 'Sec-Fetch-Dest' : `empty`,
|
|
|
+ 'Content-Type' : `application/json`,
|
|
|
+ 'Sec-Fetch-Site' : `same-site`,
|
|
|
+ 'Origin' : `https://luanshu.hbcpre.com`,
|
|
|
+ 'Cache-Control' : `no-cache`,
|
|
|
+ 'User-Agent' : gUserAgent,
|
|
|
+ 'Authorization' : ``,
|
|
|
+ 'Sec-Fetch-Mode' : `cors`,
|
|
|
+ 'Host' : `lsjk.hbcpre.com`,
|
|
|
+ 'Referer' : `https://luanshu.hbcpre.com/`,
|
|
|
+ 'Pragma' : `no-cache`,
|
|
|
+ 'Accept' : `*/*`,
|
|
|
+ 'Accept-Language' : `zh-CN,zh-Hans;q=0.9`
|
|
|
+};
|
|
|
|
|
|
async function Main() {
|
|
|
if (!magicJS.isRequest) {
|
|
|
@@ -175,13 +193,8 @@ function decryptAES(wordStr, keyStr, ivStr) {
|
|
|
|
|
|
async function openUrl(url){
|
|
|
const tokenInfo = magicJS.data.read(HbcpreConstKey.token, '');
|
|
|
- const headers = {
|
|
|
- "If-Modified-Since": "0",
|
|
|
- "Cache-Control": "no-cache",
|
|
|
- "Content-Type": "application/json",
|
|
|
- "Authorization": `Bearer ${tokenInfo}`,
|
|
|
- "User-Agent": userAgent,
|
|
|
- };
|
|
|
+ const headers = gCommonHeaders;
|
|
|
+ headers.Authorization = `Bearer ${tokenInfo}`;
|
|
|
let options = {
|
|
|
url: `${url}`,
|
|
|
headers: headers,
|
|
|
@@ -206,13 +219,9 @@ async function hbRequest(config, data) {
|
|
|
const api = config.API;
|
|
|
const method = config.METHOD;
|
|
|
const tokenInfo = magicJS.data.read(HbcpreConstKey.token, '');
|
|
|
- const headers = {
|
|
|
- "If-Modified-Since": "0",
|
|
|
- "Cache-Control": "no-cache",
|
|
|
- "Content-Type": "application/json",
|
|
|
- "Authorization": `Bearer ${tokenInfo}`,
|
|
|
- "User-Agent": userAgent,
|
|
|
- };
|
|
|
+ const headers = gCommonHeaders;
|
|
|
+ headers.Authorization = `Bearer ${tokenInfo}`;
|
|
|
+
|
|
|
data.sign_time = parseInt("".concat((new Date).getTime() / 1000));
|
|
|
const baseConfig = getBaseConfig();
|
|
|
let body = ``;
|