|
|
@@ -6,11 +6,16 @@
|
|
|
|
|
|
[rewrite_local]
|
|
|
|
|
|
+^http[s]?:\/\/app\.moutai519\.com\.cn\/xhr\/front\/user\/register\/login url script-request-body https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Scripts/imoutai/imoutaiHelper.js
|
|
|
+^http[s]?:\/\/app\.moutai519\.com\.cn\/xhr\/front\/user\/register\/login url script-response-body https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Scripts/imoutai/imoutaiHelper.js
|
|
|
+
|
|
|
+^http[s]?:\/\/app\.moutai519\.com\.cn\/xhr\/front\/user\/info url script-request-body https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Scripts/imoutai/imoutaiHelper.js
|
|
|
+^http[s]?:\/\/app\.moutai519\.com\.cn\/xhr\/front\/user\/info url script-response-body https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Scripts/imoutai/imoutaiHelper.js
|
|
|
+
|
|
|
^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
|
|
|
+^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]?:\/\/h5\.moutai519\.com\.cn\/game\/userinfo url script-request-header https://git.jojo21.top/shawenguan/Quantumult-X/raw/master/Scripts/imoutai/imoutaiHelper.js
|
|
|
|
|
|
[MITM]
|
|
|
|
|
|
@@ -151,15 +156,47 @@ 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();
|
|
|
+ }else if (path.match(/\/game\/userinfo/)) {
|
|
|
+ handleUserInfoData();
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+function handleHeads() {
|
|
|
+ let headers = $request.headers;
|
|
|
+ // lk.log(JSON.stringify(headers));
|
|
|
+
|
|
|
+ let mtToken = headers['MT-Token'];
|
|
|
+ let userAgent = headers['User-Agent'];
|
|
|
+ let mtDeviceId = headers['MT-Device-ID'];
|
|
|
+ let mtR = headers['MT-R'];
|
|
|
+ let userTag = headers['MT-User-Tag'];
|
|
|
+ let cookie = headers['Cookie'];
|
|
|
+ let appVersion = headers['MT-APP-Version'];
|
|
|
+
|
|
|
+ lk.setVal('lkMTToken', mtToken);
|
|
|
+ lk.setVal('lkMTUserAgent', userAgent);
|
|
|
+ lk.setVal('lkMTDeviceId', mtDeviceId);
|
|
|
+ lk.setVal('lkMT-R', mtR);
|
|
|
+ lk.setVal('lkMTUserTag', userTag);
|
|
|
+ lk.setVal('lkMTCookie', cookie);
|
|
|
+ lk.setVal('lkMTAppVersion', appVersion);
|
|
|
+
|
|
|
+ if(mtToken && mtToken.length > 0){
|
|
|
+ let jwtData = lk.parseJwt(mtToken);
|
|
|
+ if (jwtData) {
|
|
|
+ let payload = jwtData.payload;
|
|
|
+ let expDate = new Date(payload.exp * 1000);
|
|
|
+ let expTimeStr = lk.formatDate(expDate, 'yyyy-MM-dd HH:mm:ss');
|
|
|
+ k.setVal('lkMTTokenExpireTime', expTimeStr);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function handleLogin() {
|
|
|
+ this.handleHeads();
|
|
|
let rspBody = lk.getResponseBody();
|
|
|
if (!rspBody) {
|
|
|
return;
|
|
|
@@ -174,23 +211,12 @@ function handleLogin() {
|
|
|
let userName = rspData.userName;
|
|
|
let idCode = rspData.idCode;
|
|
|
let mobile = rspData.mobile;
|
|
|
-
|
|
|
-
|
|
|
let mtToken = rspData.token;
|
|
|
- let userAgent = headers['User-Agent'];
|
|
|
- let mtDeviceId = headers['MT-Device-ID'];
|
|
|
- let mtR = headers['MT-R'];
|
|
|
- let userTag = headers['MT-User-Tag'];
|
|
|
-
|
|
|
lk.setVal('lkMTUserId', userId);
|
|
|
lk.setVal('lkMTUserName', userName);
|
|
|
lk.setVal('lkMTIdCode', idCode);
|
|
|
lk.setVal('lkMTMobile', mobile);
|
|
|
lk.setVal('lkMTToken', mtToken);
|
|
|
- lk.setVal('lkMTUserAgent', userAgent);
|
|
|
- lk.setVal('lkMTDeviceId', mtDeviceId);
|
|
|
- lk.setVal('lkMT-R', mtR);
|
|
|
- lk.setVal('lkMTUserTag', userTag);
|
|
|
|
|
|
let jwtData = lk.parseJwt(mtToken);
|
|
|
if (jwtData) {
|
|
|
@@ -202,6 +228,7 @@ function handleLogin() {
|
|
|
}
|
|
|
|
|
|
function handleUserInfo() {
|
|
|
+ this.handleHeads();
|
|
|
let rspBody = lk.getResponseBody();
|
|
|
if (!rspBody) {
|
|
|
return;
|
|
|
@@ -216,40 +243,14 @@ function handleUserInfo() {
|
|
|
let idCode = rspData.idCode;
|
|
|
let mobile = rspData.mobile;
|
|
|
|
|
|
- let headers = $request.headers;
|
|
|
- lk.log(JSON.stringify(headers));
|
|
|
-
|
|
|
- let mtToken = headers['MT-Token'];
|
|
|
- let userAgent = headers['User-Agent'];
|
|
|
- let mtDeviceId = headers['MT-Device-ID'];
|
|
|
- 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);
|
|
|
lk.setVal('lkMTIdCode', idCode);
|
|
|
lk.setVal('lkMTMobile', mobile);
|
|
|
- lk.setVal('lkMTToken', mtToken);
|
|
|
- lk.setVal('lkMTUserAgent', userAgent);
|
|
|
- lk.setVal('lkMTDeviceId', mtDeviceId);
|
|
|
- lk.setVal('lkMT-R', mtR);
|
|
|
- lk.setVal('lkMTUserTag', userTag);
|
|
|
- lk.setVal('lkMTCookie', cookie);
|
|
|
- lk.setVal('lkMTAppVersion', appVersion);
|
|
|
-
|
|
|
- let jwtData = lk.parseJwt(mtToken);
|
|
|
- if (jwtData) {
|
|
|
- let payload = jwtData.payload;
|
|
|
- let expDate = new Date(payload.exp * 1000);
|
|
|
- let expTimeStr = lk.formatDate(expDate, 'yyyy-MM-dd HH:mm:ss');
|
|
|
- k.setVal('lkMTTokenExpireTime', expTimeStr);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
function handleMessageUnRead(){
|
|
|
-
|
|
|
+ this.handleHeads();
|
|
|
}
|
|
|
|
|
|
function handleUserIsolationPageData(){
|
|
|
@@ -261,6 +262,15 @@ function handleUserIsolationPageData(){
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+function handleUserInfoData(){
|
|
|
+ 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'),
|