shawenguan 1 سال پیش
والد
کامیت
c71c523c45
1فایلهای تغییر یافته به همراه29 افزوده شده و 10 حذف شده
  1. 29 10
      Scripts/imoutai/imoutaiHelper.js

+ 29 - 10
Scripts/imoutai/imoutaiHelper.js

@@ -7,6 +7,8 @@
 [rewrite_local]
 
 ^http[s]?:\/\/app\.moutai519\.com\.cn\/xhr\/front\/mall\/message\/unRead\/query url script-request-header https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Scripts/imoutai/imoutaiHelper.js
+^http[s]?:\/\/h5\.moutai519\.com\.cn\/game\/isolationPage\/getUserIsolationPageData url script-request-header https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Scripts/imoutai/imoutaiHelper.js
+
 ^http[s]?:\/\/app\.moutai519\.com\.cn url script-request-body https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Scripts/imoutai/imoutaiHelper.js
 ^http[s]?:\/\/app\.moutai519\.com\.cn url script-response-body https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Scripts/imoutai/imoutaiHelper.js
 
@@ -122,11 +124,12 @@ async function main() {
             });
         }
     }
-    // let retAward = await getUserEnergyAward(userData.token, userData.deviceId);
-    // if(retAward){
-    //     msgItems.push(retAward);
-    // }
-    lk.log("#############4");
+    if(!lk.isEmpty(userData.tokenWap)){
+        let retAward = await getUserEnergyAward(userData.tokenWap, userData.deviceId);
+        if(retAward){
+            msgItems.push(retAward);
+        }
+    }
     let msg = '';
     for(let i=0; i < msgItems.length; i++){
         msg += `${msgItems[i].name}:${msgItems[i].value}\n`;
@@ -148,6 +151,10 @@ function checkHandleRequest() {
             handleUserInfo();
         } else if (path.match(/\/xhr\/front\/mall\/message\/unRead\/query/)) {
             handleMessageUnRead();
+        } else if (path.match(/\/xhr\/front\/mall\/message\/unRead\/query/)) {
+            handleMessageUnRead();
+        }else if (path.match(/\/game\/isolationPage\/getUserIsolationPageData/)) {
+            handleUserIsolationPageData();
         }
     }
 }
@@ -218,6 +225,7 @@ function handleUserInfo() {
     let mtR = headers['MT-R'];
     let userTag = headers['MT-User-Tag'];
     let cookie = headers['Cookie'];
+    let appVersion = headers['MT-APP-Version'];
 
     lk.setVal('lkMTUserId', String(userId));
     lk.setVal('lkMTUserName', userName);
@@ -229,6 +237,7 @@ function handleUserInfo() {
     lk.setVal('lkMT-R', mtR);
     lk.setVal('lkMTUserTag', userTag);
     lk.setVal('lkMTCookie', cookie);
+    lk.setVal('lkMTAppVersion', appVersion);
 
     let jwtData = lk.parseJwt(mtToken);
     if (jwtData) {
@@ -243,6 +252,15 @@ function handleMessageUnRead(){
 
 }
 
+function handleUserIsolationPageData(){
+    let headers = $request.headers;
+    let cookieDict = lk.parseCookies(headers['Cookie']);
+    lk.log(JSON.stringify(cookieDict));
+    if(cookieDict['MT-Token-Wap']){
+        lk.setVal('lkMTTokenWap', cookieDict['MT-Token-Wap']);
+    }
+}
+
 function getUserData() {
     let data = {
         userId: lk.getVal('lkMTUserId'),
@@ -255,6 +273,8 @@ function getUserData() {
         mtR: lk.getVal('lkMT-R'),
         userTag: lk.getVal('lkMTUserTag'),
         cookie: lk.getVal('lkMTCookie'),
+        appVersion: lk.getVal('lkMTAppVersion'),
+        tokenWap: lk.getVal('lkMTTokenWap'),
     };
     return data;
 }
@@ -366,10 +386,9 @@ async function mtAdd(sessionId, itemId, shopId, userId, token, deviceId) {
         "shopId": String(shopId),
     };
 
-    const actParam = await getActParam(d);
-    lk.log(`actParam=${genActParam(d)}`);
+    // const actParam = await getActParam(d);
+    const actParam = genActParam(d);
     d['actParam'] = actParam;
-    lk.log(`actParam=${actParam}`);
     return new Promise((resolve, _reject) => {
         try {
             const body = JSON.stringify(d);
@@ -425,8 +444,8 @@ async function getSessionId(deviceId, token, zeroTimeStamp) {
                 "MT-Request-ID": getMTRequestId(),
                 "MT-R": G_MT_R,
                 "Accept-Encoding": "gzip, deflate, br",
-                "MT-Lat": "23.122443",
-                "MT-Lng": "113.380126",
+                "MT-Lng": iMT_Location.lng,
+                "MT-Lat": iMT_Location.lat,
             };
             const body = '';
             const url = `https://static.moutai519.com.cn/mt-backend/xhr/front/mall/index/session/get/${zeroTimeStamp}`;