mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
improve
This commit is contained in:
@@ -360,24 +360,30 @@ export class ChatService {
|
||||
}
|
||||
|
||||
refreshtoken() {
|
||||
this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||
let options = {
|
||||
headers: this.headers
|
||||
};
|
||||
return this.http.get(environment.apiURL + 'UserAuthentication/RegenereChatToken', options).subscribe(async res => {
|
||||
let data = {
|
||||
status: res['status'],
|
||||
data: {
|
||||
userId: res['data'].userId,
|
||||
authToken: res['data'].authToken
|
||||
|
||||
if(this.headers) {
|
||||
this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||
let options = {
|
||||
headers: this.headers
|
||||
};
|
||||
return this.http.get(environment.apiURL + 'UserAuthentication/RegenereChatToken', options).subscribe(async res => {
|
||||
let data = {
|
||||
status: res['status'],
|
||||
data: {
|
||||
userId: res['data'].userId,
|
||||
authToken: res['data'].authToken
|
||||
}
|
||||
}
|
||||
}
|
||||
SessionStore.user.ChatData = data
|
||||
SessionStore.save()
|
||||
SessionStore.user.ChatData = data
|
||||
SessionStore.save()
|
||||
this.setheader()
|
||||
// console.log(res)
|
||||
// console.log(SessionStore.user.ChatData)
|
||||
});
|
||||
} else {
|
||||
this.setheader()
|
||||
// console.log(res)
|
||||
// console.log(SessionStore.user.ChatData)
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user