|
|
@@ -28,6 +28,7 @@ const PingAnIKEAConstKey = {
|
|
|
x_g_vid: 'PingAnIKEA#x_g_vid',
|
|
|
x_g_rid: 'PingAnIKEA#x_g_rid',
|
|
|
PageData: 'PingAnIKEAPageData',
|
|
|
+ PageActionId: 'PageActionId',
|
|
|
};
|
|
|
|
|
|
let gRetBody;
|
|
|
@@ -73,7 +74,8 @@ const gWebUserAgent = `Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X)
|
|
|
|
|
|
let gDeviceId = magicJS.data.read(PingAnIKEAConstKey.DeviceId, 'AUUID_918d439ffcef935c2fd84d3a3e593b6523c916fc');
|
|
|
|
|
|
-const gAppUserAgent = `Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 iphone 14 pro AladdinHybrid/4.8.77 (PAEBank 6.23.0) AladdinBridge/3.0.0 subContracting/AppStore deviceId/${gDeviceId} UnionPay/1.0 PABANK deviceType/1 networkState/WIFI KiwiBridge/1.0.0 device-dpr/3 device-dr/852*393 AppStyle/BZ bz-navbarHeight/309 dzTab-navbarHeight/327 pageActionId/1F908E50`;
|
|
|
+let gPageActionId = magicJS.data.read(PingAnIKEAConstKey.PageActionId, '1F908E50');
|
|
|
+let gAppUserAgent = `Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 iphone 14 pro AladdinHybrid/4.8.77 (PAEBank 6.23.0) AladdinBridge/3.0.0 subContracting/AppStore deviceId/${gDeviceId} UnionPay/1.0 PABANK deviceType/1 networkState/WIFI KiwiBridge/1.0.0 device-dpr/3 device-dr/852*393 AppStyle/BZ bz-navbarHeight/309 dzTab-navbarHeight/327 pageActionId/${gPageActionId}`;
|
|
|
|
|
|
let gTmpRequsetTimeStamp = Date.now();
|
|
|
let gTmpRequestSortId = 100;
|
|
|
@@ -143,6 +145,9 @@ function checkHandleRequest() {
|
|
|
break;
|
|
|
case '/brop/mop/cust/mopsf/lottery/getLeftOfferNum':
|
|
|
break;
|
|
|
+ case '/brop/mop/cust/mopsf/uc/auth/lottery/sendCustomerOffer':
|
|
|
+ handleCustomerOffer();
|
|
|
+ break;
|
|
|
default:
|
|
|
if (path.indexOf('/kuaizhan/v2/5K2422/20230925/k84123/index.html') > -1) {
|
|
|
handleHomePage();
|
|
|
@@ -293,6 +298,15 @@ function handleCustomerActivityStatus() {
|
|
|
gRetBody = rspData;
|
|
|
}
|
|
|
|
|
|
+function handleCustomerOffer() {
|
|
|
+ let rspData = getResponsePlainData();
|
|
|
+ if (!rspData) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ rspData.responseCode = "000000";
|
|
|
+ gRetBody = rspData;
|
|
|
+}
|
|
|
+
|
|
|
function handleLoginStatus() {
|
|
|
|
|
|
}
|
|
|
@@ -494,7 +508,7 @@ async function tryGrabCoupon() {
|
|
|
continue;
|
|
|
}
|
|
|
// magicJS.logger.info(`activityCode=${config.activityCode} activityValue=${config.activityValue}`);
|
|
|
- let ret = await queryCustomerActivityStatus(config.activityCode, config.activityValue);
|
|
|
+ let ret = await doGrabCoupon(config.activityCode, config.activityValue);
|
|
|
let tipsText = ``;
|
|
|
if (ret) {
|
|
|
if (ret.responseCode == '900100') {//未登录
|
|
|
@@ -550,7 +564,7 @@ async function tryGrabCoupon() {
|
|
|
continue;
|
|
|
}
|
|
|
// magicJS.logger.info(`activityCode=${config.activityCode} activityValue=${config.activityValue}`);
|
|
|
- let ret = await queryCustomerActivityStatus(config.activityCode, config.activityValue);
|
|
|
+ let ret = await doGrabCoupon(config.activityCode, config.activityValue);
|
|
|
let tipsText = ``;
|
|
|
if (ret) {
|
|
|
if (ret.responseCode == '900100') {//未登录
|
|
|
@@ -591,7 +605,7 @@ async function tryGrabCoupon() {
|
|
|
continue;
|
|
|
}
|
|
|
// magicJS.logger.info(`activityCode=${config.activityCode} activityValue=${config.activityValue}`);
|
|
|
- let ret = await queryCustomerActivityStatus(config.activityCode, config.activityValue);
|
|
|
+ let ret = await doGrabCoupon(config.activityCode, config.activityValue);
|
|
|
let tipsText = ``;
|
|
|
if (ret) {
|
|
|
if (ret.responseCode == '900100') {//未登录
|
|
|
@@ -640,6 +654,14 @@ function seekWidgets(widgets, namePaths, layer = 0) {
|
|
|
return retLst;
|
|
|
}
|
|
|
|
|
|
+async function doGrabCoupon(activityCode, activityValue) {
|
|
|
+ let result = await queryCustomerActivityStatus(activityCode, activityValue);
|
|
|
+ if (result && result.responseCode == '000000') {
|
|
|
+ result = await sendCustomerOffer(activityCode, activityValue);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+}
|
|
|
+
|
|
|
async function queryCustomerActivityStatus(activityCode, activityValue, channelSource = 'KOUDAI', taskProVal = '') {
|
|
|
let reqData = {
|
|
|
activityCode: activityCode,
|
|
|
@@ -664,7 +686,7 @@ async function queryCustomerActivityStatus(activityCode, activityValue, channelS
|
|
|
magicJS.logger.error(e);
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
- const msg = `请求玩家活动状态异常\n${JSON.stringify(err)}`;
|
|
|
+ const msg = `请求用户活动状态异常\n${JSON.stringify(err)}`;
|
|
|
magicJS.logger.error(msg);
|
|
|
});
|
|
|
return result;
|
|
|
@@ -673,32 +695,88 @@ async function queryCustomerActivityStatus(activityCode, activityValue, channelS
|
|
|
async function sendCustomerOffer(activityCode, activityValue, channelSource = 'KOUDAI', taskProVal = '') {
|
|
|
let url = `https://rsb.pingan.com.cn/brop/mop/cust/mopsf/uc/auth/lottery/sendCustomerOffer`;
|
|
|
let info = {
|
|
|
- MGM: {},
|
|
|
- N: {},
|
|
|
- W: {},
|
|
|
+ MGM: {
|
|
|
+ activity_flowid: undefined,
|
|
|
+ activity_id: undefined,
|
|
|
+ },
|
|
|
+ N: {
|
|
|
+ campaignid: undefined,
|
|
|
+ channel_source: undefined,
|
|
|
+ source: 'all',
|
|
|
+ innerid: 'KDAPP-96SS-HDY-1',
|
|
|
+ outersource: undefined,
|
|
|
+ },
|
|
|
+ W: {
|
|
|
+ outerid: undefined,
|
|
|
+ },
|
|
|
};
|
|
|
let orderNo = '';
|
|
|
- let traceid = '';
|
|
|
+ let traceid = 'fixed_innerid_KDAPP-96SS-HDY-1';
|
|
|
let offerAppid = '';
|
|
|
+ let buryData = {
|
|
|
+ "login_type": `Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 iphone 14 pro AladdinHybrid/4.8.77 (PAEBank 6.23.0) AladdinBridge/3.0.0 subContracting/AppStore deviceId/AUUID_918d439ffcef935c2fd84d3a3e593b6523c916fc UnionPay/1.0 PABANK deviceType/1 networkState/WIFI KiwiBridge/1.0.0 device-dpr/3 device-dr/852*393 AppStyle/BZ bz-navbarHeight/309 dzTab-navbarHeight/327 pageActionId/${gPageActionId}`,
|
|
|
+ "idfa": "00000000-0000-0000-0000-000000000000",
|
|
|
+ "osVersion": "16.6.1",
|
|
|
+ "memoryStatus": { "totalMemory": 5644, "usedMemory": 3700 + Math.ceil(160 * Math.random()) },
|
|
|
+ "language": "zh-Hans-CN",
|
|
|
+ "deviceId": "AUUID_918d439ffcef935c2fd84d3a3e593b6523c916fc",
|
|
|
+ "deviceType": "1",
|
|
|
+ "sourceIP": "10.4.175.51",
|
|
|
+ "deviceName": "iPhone",
|
|
|
+ "vpn": "1",
|
|
|
+ "isJailBroken": false,
|
|
|
+ "deviceToken": "524be0e96038a72223cfe66c8c9044c65227c9c818225a28159100bbd9729ba4",
|
|
|
+ "wifiMac": "Not Found",
|
|
|
+ "appVersion": "6.23.0",
|
|
|
+ "wifiSid": "Not Found",
|
|
|
+ "appName": "平安口袋银行App",
|
|
|
+ "idfv": "07A9900D-FBD5-4EB4-B16D-830E090913CF",
|
|
|
+ "deviceModel": "iphone 14 pro",
|
|
|
+ "aldDeviceId": "8A093177-C77E-49B6-B096-63F736D4B9F5",
|
|
|
+ "osName": "iOS",
|
|
|
+ "sourceIPType": "04",
|
|
|
+ "subContracting": "AppStore"
|
|
|
+ };
|
|
|
let reqData = {
|
|
|
activityCode: activityCode,
|
|
|
activityValue: activityValue,
|
|
|
- activityFlowId: info.MGM.activity_flowid,
|
|
|
- activityId: info.MGM.activity_id,
|
|
|
- buryData: "",
|
|
|
- campaignId: info.N.campaignid,
|
|
|
- channelsource: info.N.channel_source,
|
|
|
+ activityFlowId: String(info.MGM.activity_flowid),
|
|
|
+ activityId: String(info.MGM.activity_id),
|
|
|
+ buryData: encodeURIComponent(JSON.stringify(buryData)),
|
|
|
+ campaignId: String(info.N.campaignid),
|
|
|
+ channelsource: String(info.N.channel_source),
|
|
|
channelSource: channelSource,
|
|
|
drawTimesQueryFLag: "1",
|
|
|
innerid: info.N.innerid,
|
|
|
orderNo: orderNo,
|
|
|
- outerid: info.W.outerid,
|
|
|
- outersource: info.N.outersource,
|
|
|
+ outerid: String(info.W.outerid),
|
|
|
+ outersource: String(info.N.outersource),
|
|
|
source: info.N.source,
|
|
|
taskProVal: taskProVal,
|
|
|
offerAppid: offerAppid,
|
|
|
traceId: traceid
|
|
|
}
|
|
|
+
|
|
|
+ let headers = gCommonHeaders;
|
|
|
+ let options = {
|
|
|
+ url: url,
|
|
|
+ headers: headers,
|
|
|
+ body: magicJS.objToQueryStr(reqData),
|
|
|
+ };
|
|
|
+
|
|
|
+ let result = await magicJS.http.post(options).then(response => {
|
|
|
+ try {
|
|
|
+ let rspData = response.body;
|
|
|
+ magicJS.logger.info(`rspData=${JSON.stringify(rspData)}`);
|
|
|
+ return rspData;
|
|
|
+ } catch (e) {
|
|
|
+ magicJS.logger.error(e);
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ const msg = `请求用户报单异常\n${JSON.stringify(err)}`;
|
|
|
+ magicJS.logger.error(msg);
|
|
|
+ });
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
Main().catch((e) => magicJS.logger.log(`-\n ${e}`)).finally(() => magicJS.done());
|