|
|
@@ -5,12 +5,12 @@
|
|
|
|
|
|
[rewrite_local]
|
|
|
|
|
|
-^https?:\/\/lsjk\.hbcpre\.com\/api url script-request-body https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Scripts/hbcpre/hbcpreHelper.js
|
|
|
-^https?:\/\/lsjk\.hbcpre\.com\/api url script-response-body https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Scripts/hbcpre/hbcpreHelper.js
|
|
|
+^https?:\/\/api\.hbcpre\.com url script-request-body https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Scripts/hbcpre/hbcpreHelper.js
|
|
|
+^https?:\/\/api\.hbcpre\.com url script-response-body https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Scripts/hbcpre/hbcpreHelper.js
|
|
|
|
|
|
[MITM]
|
|
|
|
|
|
-hostname = lsjk.hbcpre.com
|
|
|
+hostname = api.hbcpre.com
|
|
|
|
|
|
********************************/
|
|
|
const scriptName = `华文数交助手`;
|
|
|
@@ -218,22 +218,21 @@ function checkHandleRequest() {
|
|
|
default:
|
|
|
if (path.indexOf('/api/collection/indexdetail') > -1) {
|
|
|
// 个人资产-单个产品类别详情
|
|
|
- handleCollectionIdxDetail();
|
|
|
+ // handleCollectionIdxDetail();
|
|
|
}else if (path.indexOf('/api/collection/index') > -1) {
|
|
|
// 个人资产-所有产品类别列表
|
|
|
- handleCollectionIndex();
|
|
|
+ // handleCollectionIndex();
|
|
|
}else if (path.indexOf('/api/market/packlistdetail') > -1) {
|
|
|
// 产品详情
|
|
|
- handlePacklistDetail();
|
|
|
+ // handlePacklistDetail();
|
|
|
}else if (path.indexOf('/api/market/newpackorderlistdetail') > -1) {
|
|
|
// 产品列表
|
|
|
handleNewpackOrderListDetail();
|
|
|
- }else if (path.indexOf('/api/market/newpacklist') > -1) {
|
|
|
+ }else if (path.indexOf('/mall/resale/getSeriesList') > -1) {
|
|
|
// 产品类别
|
|
|
- handleNewpacklist();
|
|
|
- }else if (path.indexOf('/api/market/lablelist') > -1) {
|
|
|
- // 公告类别
|
|
|
- handleLablelist();
|
|
|
+ handleSeriesList();
|
|
|
+ }else if (path.indexOf('/mall/collector/password/login')){
|
|
|
+ //登录
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
@@ -290,39 +289,13 @@ function getRequestPlainData() {
|
|
|
reqData = JSON.parse(data);
|
|
|
} else {
|
|
|
reqData = magicJS.parseQueryStr($request.url);
|
|
|
- if(reqData.data){
|
|
|
- reqData.data = decodeURIComponent(reqData.data);
|
|
|
- }
|
|
|
- }
|
|
|
- if (!reqData || !reqData.data) {
|
|
|
- return;
|
|
|
- }
|
|
|
- if(reqData.data.length == 0){
|
|
|
- return '';
|
|
|
- }
|
|
|
- try {
|
|
|
- let baseConfig = getBaseConfig();
|
|
|
- let jsonStr = decryptAES(reqData.data.trim(), baseConfig.k, baseConfig.v);
|
|
|
- return JSON.parse(jsonStr);
|
|
|
- } catch (err) {
|
|
|
- magicJS.logger.error(err);
|
|
|
}
|
|
|
- return null;
|
|
|
+ return reqData;
|
|
|
}
|
|
|
|
|
|
function getQueryPlainData(){
|
|
|
let params = magicJS.parseQueryStr($request.url);
|
|
|
- if(!params.data){
|
|
|
- return;
|
|
|
- }
|
|
|
- try {
|
|
|
- let baseConfig = getBaseConfig();
|
|
|
- let jsonStr = decryptAES(decodeURIComponent(params.data).trim(), baseConfig.k, baseConfig.v);
|
|
|
- return JSON.parse(jsonStr);
|
|
|
- } catch (err) {
|
|
|
- magicJS.logger.error(err);
|
|
|
- }
|
|
|
- return null;
|
|
|
+ return params;
|
|
|
}
|
|
|
|
|
|
function handleBlackOrWhite() {
|
|
|
@@ -363,47 +336,17 @@ function handleUserInfo() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function handleLablelist() {
|
|
|
+function handleSeriesList(){
|
|
|
let rspData = getResponsePlainData();
|
|
|
if (!rspData) {
|
|
|
return;
|
|
|
}
|
|
|
- if (rspData.code != 1000) {
|
|
|
- return;
|
|
|
- }
|
|
|
- rspData = {
|
|
|
- code: 1000,
|
|
|
- message: '获取成功',
|
|
|
- data: [
|
|
|
- {
|
|
|
- lable: '全部',
|
|
|
- weight: 100,
|
|
|
- },
|
|
|
- {
|
|
|
- lable: '我的关注',
|
|
|
- weight: 1,
|
|
|
- },
|
|
|
- ]
|
|
|
- };
|
|
|
- const baseConfig = getBaseConfig();
|
|
|
- if (baseConfig.encrypt) {
|
|
|
- gRetBody = encryptAES(JSON.stringify(rspData), baseConfig.k, baseConfig.v);
|
|
|
- } else {
|
|
|
- gRetBody = rspData;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-function handleNewpacklist(){
|
|
|
- let rspData = getResponsePlainData();
|
|
|
- if (!rspData) {
|
|
|
- return;
|
|
|
- }
|
|
|
- if (rspData.code != 1000) {
|
|
|
+ if (rspData.code != 200) {
|
|
|
return;
|
|
|
}
|
|
|
let dataList = magicJS.data.read(HbcpreConstKey.collectionClassList, []);
|
|
|
let reqData = getQueryPlainData();
|
|
|
- let lable = reqData.lable;
|
|
|
+ let nftType = reqData.nftType || 0;//0=数字资产 1=盲盒
|
|
|
|
|
|
let tmpItemDict = {};
|
|
|
for(let i=0; i < dataList.length; i++){
|
|
|
@@ -411,20 +354,16 @@ function handleNewpacklist(){
|
|
|
tmpItemDict[id] = dataList[i];
|
|
|
}
|
|
|
|
|
|
- let itemData = rspData.data.data;
|
|
|
+ let itemData = rspData.data.list;
|
|
|
for(let i=0; i < itemData.length; i++){
|
|
|
const iData = itemData[i];
|
|
|
- // is_bidding //竞投
|
|
|
- // all_num //发行
|
|
|
- // lt_num //流通
|
|
|
+ // quantityNumber //发行
|
|
|
+ // soldNum //流通
|
|
|
|
|
|
const id = iData.id;
|
|
|
tmpItemDict[id] = iData;
|
|
|
// 退市标志
|
|
|
- if(iData.pay_price == void 0){
|
|
|
- iData.pay_price = '99999.99';
|
|
|
- iData.is_delisted = 1; //0=退市
|
|
|
- }
|
|
|
+ iData.isSpillover = 1;
|
|
|
}
|
|
|
|
|
|
dataList = [];
|
|
|
@@ -477,113 +416,6 @@ function handleNewpackOrderListDetail(){
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function handlePacklistDetail(){
|
|
|
- let rspData = getResponsePlainData();
|
|
|
- if (!rspData) {
|
|
|
- return;
|
|
|
- }
|
|
|
- if (rspData.code != 1000) {
|
|
|
- return;
|
|
|
- }
|
|
|
- let itemData = rspData.data;
|
|
|
- if(itemData.lock_uid && itemData.lock_uid > 0){
|
|
|
- itemData.lock_uid = null;
|
|
|
- itemData.lock_time = null;
|
|
|
- itemData.pay_price = `${itemData.pay_price}#0`;
|
|
|
- itemData.pay_type1 = 1;
|
|
|
- itemData.pay_type2 = 1;
|
|
|
- itemData.pay_type3 = 1;
|
|
|
- itemData.pay_type4 = 1;
|
|
|
- }
|
|
|
- const baseConfig = getBaseConfig();
|
|
|
- if (baseConfig.encrypt) {
|
|
|
- gRetBody = encryptAES(JSON.stringify(rspData), baseConfig.k, baseConfig.v);
|
|
|
- } else {
|
|
|
- gRetBody = rspData;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-function handleCollectionIdxDetail(){
|
|
|
- // let rspData = {
|
|
|
- // "code": 1000,
|
|
|
- // "message": "获取成功",
|
|
|
- // "data": {
|
|
|
- // "current_page": 1,
|
|
|
- // "data": [
|
|
|
- // {
|
|
|
- // "title": "黑卡",
|
|
|
- // "image": "https://luanshu.hbcpre.com/uploads/collection/96d4bd988be689544757ae1dcc9c8d20.jpg",
|
|
|
- // "tag": null,
|
|
|
- // "collection_id": 2988,
|
|
|
- // "num": 2355867,
|
|
|
- // "id": 2309705,
|
|
|
- // "all_num": 9622378,
|
|
|
- // "remark": "空投",
|
|
|
- // "status": 0
|
|
|
- // },
|
|
|
- // ],
|
|
|
- // "first_page_url": "https://lsjk.hbcpre.com/api/collection/indexdetail?page=1",
|
|
|
- // "from": 1,
|
|
|
- // "last_page": 1,
|
|
|
- // "last_page_url": "https://lsjk.hbcpre.com/api/collection/indexdetail?page=1",
|
|
|
- // "links": [
|
|
|
- // {
|
|
|
- // "url": null,
|
|
|
- // "label": "« Previous",
|
|
|
- // "active": false
|
|
|
- // },
|
|
|
- // {
|
|
|
- // "url": "https://lsjk.hbcpre.com/api/collection/indexdetail?page=1",
|
|
|
- // "label": "1",
|
|
|
- // "active": true
|
|
|
- // },
|
|
|
- // {
|
|
|
- // "url": null,
|
|
|
- // "label": "Next »",
|
|
|
- // "active": false
|
|
|
- // }
|
|
|
- // ],
|
|
|
- // "next_page_url": null,
|
|
|
- // "path": "https://lsjk.hbcpre.com/api/collection/indexdetail",
|
|
|
- // "per_page": 999,
|
|
|
- // "prev_page_url": null,
|
|
|
- // "to": 1,
|
|
|
- // "total": 1
|
|
|
- // }
|
|
|
- // };
|
|
|
-}
|
|
|
-
|
|
|
-function handleCollectionIndex(){
|
|
|
- let rspData = getResponsePlainData();
|
|
|
- if (!rspData) {
|
|
|
- return;
|
|
|
- }
|
|
|
- if (rspData.code != 1000) {
|
|
|
- return;
|
|
|
- }
|
|
|
- readItemCntRwDict();
|
|
|
- let dataList = rspData.data.data;
|
|
|
-
|
|
|
- for(let i=0; i < dataList.length; i++){
|
|
|
- const id = dataList[i].collection_id;
|
|
|
- const name = dataList[i].title;
|
|
|
- const realNum = dataList[i].num;
|
|
|
- if(gItemCntRwDict[id] != void 0){
|
|
|
- dataList[i].num = gItemCntRwDict[id];
|
|
|
- } else if(gItemCntRwDict[name] != void 0){
|
|
|
- dataList[i].num = gItemCntRwDict[name];
|
|
|
- }
|
|
|
- dataList[i].title = `${name}#${realNum} 均价:${dataList[i].avg_price}`;
|
|
|
- }
|
|
|
-
|
|
|
- const baseConfig = getBaseConfig();
|
|
|
- if (baseConfig.encrypt) {
|
|
|
- gRetBody = encryptAES(JSON.stringify(rspData), baseConfig.k, baseConfig.v);
|
|
|
- } else {
|
|
|
- gRetBody = rspData;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
function handleCompoundIndex(){
|
|
|
let rspData = getResponsePlainData();
|
|
|
if (!rspData) {
|
|
|
@@ -705,14 +537,14 @@ function transformKeys(keyStr) {
|
|
|
function getBaseConfig() {
|
|
|
let config = {
|
|
|
"h5_host": "https://luanshu.hbcpre.com",
|
|
|
- "api_host": "https://lsjk.hbcpre.com",
|
|
|
+ "api_host": "https://api.hbcpre.com",
|
|
|
"upload_url": "https://lsjk.hbcpre.com/api/user/upload",
|
|
|
"name": "华文数交",
|
|
|
"icon": "",
|
|
|
"logo": "/static/default/common/login-logo.png",
|
|
|
"k": transformKeys("X2931Ur0r023I9PD"),
|
|
|
"v": transformKeys("g809i9823j7nJ9j7"),
|
|
|
- "encrypt": true
|
|
|
+ "encrypt": false
|
|
|
};
|
|
|
return config;
|
|
|
}
|