登陆增加 token 参数

release
Jimmy Liow 2 years ago
parent 917a9d4c32
commit e76504a581

@ -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',

Loading…
Cancel
Save