|
@@ -95,7 +95,8 @@ async function getLoginJumpUrl(url){
|
|
|
magicJS.http.get(options).then(resp => {
|
|
magicJS.http.get(options).then(resp => {
|
|
|
const htmlText = resp.body;
|
|
const htmlText = resp.body;
|
|
|
try {
|
|
try {
|
|
|
- // magicJS.logger.info(`页面数据:${data}`);
|
|
|
|
|
|
|
+ // magicJS.logger.info(`页面数据:${htmlText}`);
|
|
|
|
|
+ magicJS.logger.info(`响应头部:${JSON.stringify(resp.headers)}`);
|
|
|
let urlMatch = htmlText.match(/https?:\/\/[^\s'"]+/); // 正则表达式匹配
|
|
let urlMatch = htmlText.match(/https?:\/\/[^\s'"]+/); // 正则表达式匹配
|
|
|
if(urlMatch){
|
|
if(urlMatch){
|
|
|
resolve(urlMatch[0]);
|
|
resolve(urlMatch[0]);
|
|
@@ -129,7 +130,8 @@ async function getLoginAccoutUrl(url){
|
|
|
magicJS.http.get(options).then(resp => {
|
|
magicJS.http.get(options).then(resp => {
|
|
|
const htmlText = resp.body;
|
|
const htmlText = resp.body;
|
|
|
try {
|
|
try {
|
|
|
- magicJS.logger.info(`页面数据:${JSON.stringify(resp.headers)}`);
|
|
|
|
|
|
|
+ // magicJS.logger.info(`页面数据:${htmlText}`);
|
|
|
|
|
+ magicJS.logger.info(`响应头部:${JSON.stringify(resp.headers)}`);
|
|
|
let urlMatch = htmlText.match(/<a id="j-tab-login-link"[^>]*href="([^"]+)"/); // 正则表达式匹配
|
|
let urlMatch = htmlText.match(/<a id="j-tab-login-link"[^>]*href="([^"]+)"/); // 正则表达式匹配
|
|
|
if(urlMatch){
|
|
if(urlMatch){
|
|
|
resolve(urlMatch[1]);
|
|
resolve(urlMatch[1]);
|
|
@@ -217,10 +219,6 @@ function getLoginData(url){
|
|
|
retData[name] = value;
|
|
retData[name] = value;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- // magicJS.logger.log(JSON.stringify(cookieData));
|
|
|
|
|
-
|
|
|
|
|
- magicJS.logger.log(JSON.stringify(htmlText));
|
|
|
|
|
-
|
|
|
|
|
magicJS.logger.log(JSON.stringify(retData));
|
|
magicJS.logger.log(JSON.stringify(retData));
|
|
|
resolve(retData);
|
|
resolve(retData);
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
@@ -543,7 +541,7 @@ async function checkWapLogin(username, password, extData){
|
|
|
//以下几个动态生成的
|
|
//以下几个动态生成的
|
|
|
"QRCODE": extData.QRCODE,
|
|
"QRCODE": extData.QRCODE,
|
|
|
"pageOp": extData.pageOp,
|
|
"pageOp": extData.pageOp,
|
|
|
- "JSESSIONID": "aaapv0b8Wd4vJaKLOYg6y",
|
|
|
|
|
|
|
+ // "JSESSIONID": "aaapv0b8Wd4vJaKLOYg6y",
|
|
|
}
|
|
}
|
|
|
let body = magicJS.objToQueryStr(reqData,true);
|
|
let body = magicJS.objToQueryStr(reqData,true);
|
|
|
magicJS.logger.info(`body= ${body}`);
|
|
magicJS.logger.info(`body= ${body}`);
|
|
@@ -557,7 +555,7 @@ async function checkWapLogin(username, password, extData){
|
|
|
"LT": extData.lt,
|
|
"LT": extData.lt,
|
|
|
"Referer": 'https://open.e.189.cn/',
|
|
"Referer": 'https://open.e.189.cn/',
|
|
|
"User-Agent": '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',
|
|
"User-Agent": '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',
|
|
|
- // "Cookie": magicJS.serializeCookies(cookieData),
|
|
|
|
|
|
|
+ "Cookie": magicJS.serializeCookies(cookieData),
|
|
|
},
|
|
},
|
|
|
body: ``,
|
|
body: ``,
|
|
|
};
|
|
};
|
|
@@ -606,6 +604,47 @@ function wapLogin(username, password){
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+async function getLoginScanUrl(url){
|
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
|
+ let body = ``;
|
|
|
|
|
+ let options = {
|
|
|
|
|
+ url: url,
|
|
|
|
|
+ headers: {
|
|
|
|
|
+ "Accept": "*/*",
|
|
|
|
|
+ "Accept-Encoding": "gzip, deflate, br",
|
|
|
|
|
+ "Accept-Language": "zh-cn",
|
|
|
|
|
+ "Connection": "keep-alive",
|
|
|
|
|
+ "Content-Type": "application/x-www-form-urlencoded",
|
|
|
|
|
+ },
|
|
|
|
|
+ body: body
|
|
|
|
|
+ }
|
|
|
|
|
+ magicJS.http.get(options).then(resp => {
|
|
|
|
|
+ const htmlText = resp.body;
|
|
|
|
|
+ try {
|
|
|
|
|
+ // magicJS.logger.info(`页面数据:${htmlText}`);
|
|
|
|
|
+ let urlMatch = htmlText.match(/<a id="j-tab-login-link"[^>]*href="([^"]+)"/); // 正则表达式匹配
|
|
|
|
|
+ if(urlMatch){
|
|
|
|
|
+ resolve(urlMatch[1]);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ resolve();
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (err) {
|
|
|
|
|
+ resolve();
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+ const msg = `获取页面数据异常\n${JSON.stringify(err)}`;
|
|
|
|
|
+ magicJS.logger.error(msg);
|
|
|
|
|
+ reject(msg);
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+function scanLogin(){
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
Main();
|
|
Main();
|
|
|
|
|
|
|
|
|
|
|