|
@@ -243,38 +243,24 @@ async function login(username, password){
|
|
|
magicJS.logger.info(`password:${password}`);
|
|
magicJS.logger.info(`password:${password}`);
|
|
|
let reqData = {
|
|
let reqData = {
|
|
|
appKey: "cloud",
|
|
appKey: "cloud",
|
|
|
- accountType: '02',
|
|
|
|
|
- dynamicCheck: false,
|
|
|
|
|
|
|
+ accountType: '01',
|
|
|
userName: `{RSA}${username}`,
|
|
userName: `{RSA}${username}`,
|
|
|
epd: `{RSA}${password}`,
|
|
epd: `{RSA}${password}`,
|
|
|
validateCode: "",
|
|
validateCode: "",
|
|
|
captchaToken: extData.captchaToken,
|
|
captchaToken: extData.captchaToken,
|
|
|
returnUrl: extData.returnUrl,
|
|
returnUrl: extData.returnUrl,
|
|
|
- isOauth2: false,
|
|
|
|
|
mailSuffix: "@189.cn",
|
|
mailSuffix: "@189.cn",
|
|
|
paramId: extData.paramId,
|
|
paramId: extData.paramId,
|
|
|
- lt: extData.lt,
|
|
|
|
|
- REQID: 'c8d6f7fb3b204eeb',
|
|
|
|
|
- callbackMsg: '',
|
|
|
|
|
};
|
|
};
|
|
|
let body = magicJS.objToQueryStr(reqData,true);
|
|
let body = magicJS.objToQueryStr(reqData,true);
|
|
|
magicJS.logger.info(`body= ${body}`);
|
|
magicJS.logger.info(`body= ${body}`);
|
|
|
let options = {
|
|
let options = {
|
|
|
- url: `https://open.e.189.cn/api/logbox/oauth2/loginSubmit.do?${body}`,
|
|
|
|
|
|
|
+ url: `https://open.e.189.cn/api/logbox/oauth2/loginSubmit.do`,
|
|
|
headers: {
|
|
headers: {
|
|
|
- "Accept": "*/*",
|
|
|
|
|
- "Accept-Encoding": "gzip, deflate, br",
|
|
|
|
|
- "Accept-Language": "zh-cn",
|
|
|
|
|
- "Connection": "keep-alive",
|
|
|
|
|
- "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',
|
|
|
- "isSetCookie": 1,
|
|
|
|
|
- "GRAYNUMBER": "B64274D9475A54D406616FF4EB01E26E",
|
|
|
|
|
- "DEVICEID": "DA64A6047ABEAC149EA6DD30A38CC0FA=0C3E335A89CFE785599532B97FE68F02",
|
|
|
|
|
- "GUID": "c294a989d68d49e0bc0f3bae427ba000",
|
|
|
|
|
},
|
|
},
|
|
|
- body: ``,
|
|
|
|
|
|
|
+ body: body,
|
|
|
};
|
|
};
|
|
|
magicJS.http.post(options).then(resp => {
|
|
magicJS.http.post(options).then(resp => {
|
|
|
const rspData = resp.body;
|
|
const rspData = resp.body;
|
|
@@ -292,6 +278,74 @@ async function login(username, password){
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// async function login(username, password){
|
|
|
|
|
+// return new Promise(async (resolve, reject) => {
|
|
|
|
|
+// let url = await getLoginUrl();
|
|
|
|
|
+// let extData = null;
|
|
|
|
|
+// if(url){
|
|
|
|
|
+// extData = await getLoginData(url);
|
|
|
|
|
+// }
|
|
|
|
|
+// if(!extData){
|
|
|
|
|
+// resolve(false);
|
|
|
|
|
+// return;
|
|
|
|
|
+// }
|
|
|
|
|
+// magicJS.logger.info(`登录1`);
|
|
|
|
|
+// username = rsaEncode(extData.j_rsakey, username);
|
|
|
|
|
+// magicJS.logger.info(`登录2`);
|
|
|
|
|
+// password = rsaEncode(extData.j_rsakey, password);
|
|
|
|
|
+// magicJS.logger.info(`username:${username}`);
|
|
|
|
|
+// magicJS.logger.info(`password:${password}`);
|
|
|
|
|
+// let reqData = {
|
|
|
|
|
+// appKey: "cloud",
|
|
|
|
|
+// accountType: '02',
|
|
|
|
|
+// dynamicCheck: false,
|
|
|
|
|
+// userName: `{RSA}${username}`,
|
|
|
|
|
+// epd: `{RSA}${password}`,
|
|
|
|
|
+// validateCode: "",
|
|
|
|
|
+// captchaToken: extData.captchaToken,
|
|
|
|
|
+// returnUrl: extData.returnUrl,
|
|
|
|
|
+// isOauth2: false,
|
|
|
|
|
+// mailSuffix: "@189.cn",
|
|
|
|
|
+// paramId: extData.paramId,
|
|
|
|
|
+// lt: extData.lt,
|
|
|
|
|
+// REQID: 'c8d6f7fb3b204eeb',
|
|
|
|
|
+// callbackMsg: '',
|
|
|
|
|
+// };
|
|
|
|
|
+// let body = magicJS.objToQueryStr(reqData,true);
|
|
|
|
|
+// magicJS.logger.info(`body= ${body}`);
|
|
|
|
|
+// let options = {
|
|
|
|
|
+// url: `https://open.e.189.cn/api/logbox/oauth2/loginSubmit.do?${body}`,
|
|
|
|
|
+// headers: {
|
|
|
|
|
+// "Accept": "*/*",
|
|
|
|
|
+// "Accept-Encoding": "gzip, deflate, br",
|
|
|
|
|
+// "Accept-Language": "zh-cn",
|
|
|
|
|
+// "Connection": "keep-alive",
|
|
|
|
|
+// "LT": extData.lt,
|
|
|
|
|
+// "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',
|
|
|
|
|
+// "isSetCookie": 1,
|
|
|
|
|
+// "GRAYNUMBER": "B64274D9475A54D406616FF4EB01E26E",
|
|
|
|
|
+// "DEVICEID": "DA64A6047ABEAC149EA6DD30A38CC0FA=0C3E335A89CFE785599532B97FE68F02",
|
|
|
|
|
+// "GUID": "c294a989d68d49e0bc0f3bae427ba000",
|
|
|
|
|
+// },
|
|
|
|
|
+// body: ``,
|
|
|
|
|
+// };
|
|
|
|
|
+// magicJS.http.post(options).then(resp => {
|
|
|
|
|
+// const rspData = resp.body;
|
|
|
|
|
+// try {
|
|
|
|
|
+// magicJS.logger.info(`接口数据:${JSON.stringify(rspData)}`);
|
|
|
|
|
+// resolve(true);
|
|
|
|
|
+// } catch (err) {
|
|
|
|
|
+// resolve(false);
|
|
|
|
|
+// }
|
|
|
|
|
+// }).catch(err => {
|
|
|
|
|
+// const msg = `获取页面数据异常\n${JSON.stringify(err)}`;
|
|
|
|
|
+// magicJS.logger.error(msg);
|
|
|
|
|
+// resolve(false);
|
|
|
|
|
+// });
|
|
|
|
|
+// });
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
Main();
|
|
Main();
|
|
|
|
|
|
|
|
|
|
|