|
|
@@ -36,6 +36,7 @@ let G_USER_AGENT = 'iOS;16.6.1;Apple;?unrecognized?';
|
|
|
|
|
|
const G_AES_KEY = "qbhajinldepmucsonaaaccgypwuvcjaa";
|
|
|
const G_AES_IV = "2018534749963515";
|
|
|
+const G_SALT = "2af72f100c356273d46284f6fd1dfc08";
|
|
|
|
|
|
const iMT_Products = {
|
|
|
"10941": "53%vol 500ml贵州茅台酒(甲辰龙年)",
|
|
|
@@ -971,6 +972,24 @@ async function getUserEnergyAward(token, deviceId) {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+function signature(data, timestamp) {
|
|
|
+ let keys = [];
|
|
|
+ for(let k in data){
|
|
|
+ keys.push(k)
|
|
|
+ }
|
|
|
+ keys.sort();
|
|
|
+ let tempV = '';
|
|
|
+ for(let k of keys){
|
|
|
+ tempV += data[k];
|
|
|
+ }
|
|
|
+ timestamp = timestamp || `${new Date().getTime()}`;
|
|
|
+ let text = G_SALT + tempV + timestamp;
|
|
|
+ let CryptoJS = createCryptoJS();
|
|
|
+ let hash = CryptoJS.MD5(text);
|
|
|
+ let md5Str = hash.toString(CryptoJS.enc.Hex);
|
|
|
+ return md5Str;
|
|
|
+}
|
|
|
+
|
|
|
async function login(phone, vCode, deviceId) {
|
|
|
const mtK = `${new Date().getTime()}`;
|
|
|
const mtV = await getMtv(deviceId, G_MT_VERSION);
|
|
|
@@ -998,6 +1017,10 @@ async function login(phone, vCode, deviceId) {
|
|
|
'vCode': vCode,
|
|
|
'ydLogId': '',
|
|
|
};
|
|
|
+ let timestamp = `${new Date().getTime()}`;
|
|
|
+ data.md5 = signature(data, timestamp);
|
|
|
+ data.timestamp = timestamp;
|
|
|
+ data['MT-APP-Version'] = G_MT_VERSION;
|
|
|
const body = JSON.stringify(data);
|
|
|
const url = `https://app.moutai519.com.cn/xhr/front/user/register/login`;
|
|
|
let options = {
|
|
|
@@ -1049,7 +1072,7 @@ async function getLoginVCode(mobile, deviceId) {
|
|
|
return new Promise((resolve, _reject) => {
|
|
|
try {
|
|
|
let timestamp = `${new Date().getTime()}`;
|
|
|
- let md5Str = '2af72f100c356273d46284f6fd1dfc08' + mobile + timestamp;
|
|
|
+ let md5Str = G_SALT + mobile + timestamp;
|
|
|
let CryptoJS = createCryptoJS();
|
|
|
let hash = CryptoJS.MD5(md5Str);
|
|
|
md5Str = hash.toString(CryptoJS.enc.Hex);
|