|
|
@@ -708,62 +708,62 @@ async function getProvinceCityMapData() {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-async function login(phone, vCode, deviceId) {
|
|
|
- const mtK = `${new Date().getTime()}`;
|
|
|
- const mtV = await getMtv(deviceId, G_MT_VERSION);
|
|
|
- const headers = {
|
|
|
- 'mt-device-id': deviceId,
|
|
|
- 'mt-user-tag': '0',
|
|
|
- 'accept': '*/*',
|
|
|
- 'mt-network-type': 'WIFI',
|
|
|
- 'mt-token': '',
|
|
|
- "mt-team-id": "",
|
|
|
- 'mt-k': mtK,
|
|
|
- 'mt-bundle-id': 'com.moutai.mall',
|
|
|
- 'mt-v': mtV,
|
|
|
- 'user-agent': 'iOS;16.0.1;Apple;iPhone 14 ProMax',
|
|
|
- 'accept-language': 'zh-Hans-CN;q=1',
|
|
|
- 'mt-request-id': `${new Date().getTime()}18342`,
|
|
|
- 'mt-r': G_MT_R,
|
|
|
- 'mt-app-version': G_MT_VERSION,
|
|
|
- };
|
|
|
- return new Promise((resolve, _reject) => {
|
|
|
- try {
|
|
|
- const data = {
|
|
|
- 'ydToken': '',
|
|
|
- 'mobile': phone,
|
|
|
- 'vCode': vCode,
|
|
|
- 'ydLogId': '',
|
|
|
- };
|
|
|
- const body = JSON.stringify(data);
|
|
|
- const url = `https://app.moutai519.com.cn/xhr/front/user/register/login`;
|
|
|
- let options = {
|
|
|
- url: url,
|
|
|
- headers: headers,
|
|
|
- body: body
|
|
|
- };
|
|
|
- lk.post(options, async (error, _response, data) => {
|
|
|
- let ret;
|
|
|
- try {
|
|
|
- if (error) {
|
|
|
- lk.execFail();
|
|
|
- } else {
|
|
|
- const jsonRetObj = JSON.parse(data);
|
|
|
- ret = jsonRetObj.data || {};
|
|
|
- }
|
|
|
- } catch (e) {
|
|
|
- lk.logErr(e);
|
|
|
- lk.execFail();
|
|
|
- } finally {
|
|
|
- resolve(ret);
|
|
|
- }
|
|
|
- });
|
|
|
- } catch (e) {
|
|
|
- lk.logErr(e);
|
|
|
- resolve();
|
|
|
- }
|
|
|
- });
|
|
|
-}
|
|
|
+// async function login(phone, vCode, deviceId) {
|
|
|
+// const mtK = `${new Date().getTime()}`;
|
|
|
+// const mtV = await getMtv(deviceId, G_MT_VERSION);
|
|
|
+// const headers = {
|
|
|
+// 'mt-device-id': deviceId,
|
|
|
+// 'mt-user-tag': '0',
|
|
|
+// 'accept': '*/*',
|
|
|
+// 'mt-network-type': 'WIFI',
|
|
|
+// 'mt-token': '',
|
|
|
+// "mt-team-id": "",
|
|
|
+// 'mt-k': mtK,
|
|
|
+// 'mt-bundle-id': 'com.moutai.mall',
|
|
|
+// 'mt-v': mtV,
|
|
|
+// 'user-agent': 'iOS;16.0.1;Apple;iPhone 14 ProMax',
|
|
|
+// 'accept-language': 'zh-Hans-CN;q=1',
|
|
|
+// 'mt-request-id': `${new Date().getTime()}18342`,
|
|
|
+// 'mt-r': G_MT_R,
|
|
|
+// 'mt-app-version': G_MT_VERSION,
|
|
|
+// };
|
|
|
+// return new Promise((resolve, _reject) => {
|
|
|
+// try {
|
|
|
+// const data = {
|
|
|
+// 'ydToken': '',
|
|
|
+// 'mobile': phone,
|
|
|
+// 'vCode': vCode,
|
|
|
+// 'ydLogId': '',
|
|
|
+// };
|
|
|
+// const body = JSON.stringify(data);
|
|
|
+// const url = `https://app.moutai519.com.cn/xhr/front/user/register/login`;
|
|
|
+// let options = {
|
|
|
+// url: url,
|
|
|
+// headers: headers,
|
|
|
+// body: body
|
|
|
+// };
|
|
|
+// lk.post(options, async (error, _response, data) => {
|
|
|
+// let ret;
|
|
|
+// try {
|
|
|
+// if (error) {
|
|
|
+// lk.execFail();
|
|
|
+// } else {
|
|
|
+// const jsonRetObj = JSON.parse(data);
|
|
|
+// ret = jsonRetObj.data || {};
|
|
|
+// }
|
|
|
+// } catch (e) {
|
|
|
+// lk.logErr(e);
|
|
|
+// lk.execFail();
|
|
|
+// } finally {
|
|
|
+// resolve(ret);
|
|
|
+// }
|
|
|
+// });
|
|
|
+// } catch (e) {
|
|
|
+// lk.logErr(e);
|
|
|
+// resolve();
|
|
|
+// }
|
|
|
+// });
|
|
|
+// }
|
|
|
|
|
|
// async function getLoginVCode(mobile, deviceId) {
|
|
|
// const headers = {
|