From e76504a5811e5075094cc56181524981041ed217 Mon Sep 17 00:00:00 2001 From: Jimmy Liow <18777396951@163.com> Date: Tue, 23 May 2023 15:53:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E9=99=86=E5=A2=9E=E5=8A=A0=20token=20?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/Auth.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/stores/Auth.js b/src/stores/Auth.js index 9c8fe24..765c61c 100644 --- a/src/stores/Auth.js +++ b/src/stores/Auth.js @@ -19,6 +19,7 @@ class Auth { return postForm(postUrl, formData) .then(json => { if (json.errcode == 0) { + this.login.token = json.Result.token; return json.Result.WU_LMI_SN; } else { throw new Error(json.errmsg + ': ' + json.errcode); @@ -29,23 +30,22 @@ class Auth { fetchUserDetail(userId) { const fetchUrl = prepareUrl(HT_HOST + '/service-CooperateSOA/GetLinkManInfo') .append('LMI_SN', userId) + .append('token', this.login.token) .build(); return fetchJSON(fetchUrl) .then(json => { if (json.errcode == 0) { runInAction(() => { - this.login = { - userId: json.Result.LMI_SN, - username: json.Result.LoginName, - travelAgencyId: json.Result.LMI_VEI_SN, - travelAgencyName: json.Result.VName, - telephone: json.Result.LkPhone, - emailAddress: json.Result.LMI_listmail, - cityId: json.Result.citysn - } + this.login.userId = json.Result.LMI_SN, + this.login.username = json.Result.LoginName, + this.login.travelAgencyId = json.Result.LMI_VEI_SN, + this.login.travelAgencyName = json.Result.VName, + this.login.telephone = json.Result.LkPhone, + this.login.emailAddress = json.Result.LMI_listmail, + this.login.cityId = json.Result.citysn }); - return json.Result.LoginName; + return this.login; } else { throw new Error(json.errmsg + ': ' + json.errcode); } @@ -57,6 +57,7 @@ class Auth { formData.append('UserID', this.login.userId); formData.append('Password', password); formData.append('NewPassword', newPassword); + formData.append('token', this.login.token); const postUrl = HT_HOST + '/service-CooperateSOA/SetPassword'; return postForm(postUrl, formData) @@ -70,9 +71,10 @@ class Auth { } login = { - userId: 1, + token: '249FC25C949B4BB182431F89762AE5E8', + userId: 1, // LMI_SN username: 'Vu Xuan Giang', - travelAgencyId: 32531, //30008供应商id对应HT的VEI_SN + travelAgencyId: 32531, // VEI_SN travelAgencyName: 'ANP', telephone: '000', emailAddress: 'abc@123.com',