登陆增加 token 参数

release
Jimmy Liow 2 years ago
parent 917a9d4c32
commit e76504a581

@ -19,6 +19,7 @@ class Auth {
return postForm(postUrl, formData) return postForm(postUrl, formData)
.then(json => { .then(json => {
if (json.errcode == 0) { if (json.errcode == 0) {
this.login.token = json.Result.token;
return json.Result.WU_LMI_SN; return json.Result.WU_LMI_SN;
} else { } else {
throw new Error(json.errmsg + ': ' + json.errcode); throw new Error(json.errmsg + ': ' + json.errcode);
@ -29,23 +30,22 @@ class Auth {
fetchUserDetail(userId) { fetchUserDetail(userId) {
const fetchUrl = prepareUrl(HT_HOST + '/service-CooperateSOA/GetLinkManInfo') const fetchUrl = prepareUrl(HT_HOST + '/service-CooperateSOA/GetLinkManInfo')
.append('LMI_SN', userId) .append('LMI_SN', userId)
.append('token', this.login.token)
.build(); .build();
return fetchJSON(fetchUrl) return fetchJSON(fetchUrl)
.then(json => { .then(json => {
if (json.errcode == 0) { if (json.errcode == 0) {
runInAction(() => { runInAction(() => {
this.login = { this.login.userId = json.Result.LMI_SN,
userId: json.Result.LMI_SN, this.login.username = json.Result.LoginName,
username: json.Result.LoginName, this.login.travelAgencyId = json.Result.LMI_VEI_SN,
travelAgencyId: json.Result.LMI_VEI_SN, this.login.travelAgencyName = json.Result.VName,
travelAgencyName: json.Result.VName, this.login.telephone = json.Result.LkPhone,
telephone: json.Result.LkPhone, this.login.emailAddress = json.Result.LMI_listmail,
emailAddress: json.Result.LMI_listmail, this.login.cityId = json.Result.citysn
cityId: json.Result.citysn
}
}); });
return json.Result.LoginName; return this.login;
} else { } else {
throw new Error(json.errmsg + ': ' + json.errcode); throw new Error(json.errmsg + ': ' + json.errcode);
} }
@ -57,6 +57,7 @@ class Auth {
formData.append('UserID', this.login.userId); formData.append('UserID', this.login.userId);
formData.append('Password', password); formData.append('Password', password);
formData.append('NewPassword', newPassword); formData.append('NewPassword', newPassword);
formData.append('token', this.login.token);
const postUrl = HT_HOST + '/service-CooperateSOA/SetPassword'; const postUrl = HT_HOST + '/service-CooperateSOA/SetPassword';
return postForm(postUrl, formData) return postForm(postUrl, formData)
@ -70,9 +71,10 @@ class Auth {
} }
login = { login = {
userId: 1, token: '249FC25C949B4BB182431F89762AE5E8',
userId: 1, // LMI_SN
username: 'Vu Xuan Giang', username: 'Vu Xuan Giang',
travelAgencyId: 32531, //30008供应商id对应HT的VEI_SN travelAgencyId: 32531, // VEI_SN
travelAgencyName: 'ANP', travelAgencyName: 'ANP',
telephone: '000', telephone: '000',
emailAddress: 'abc@123.com', emailAddress: 'abc@123.com',

Loading…
Cancel
Save