mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
improve
This commit is contained in:
@@ -45,7 +45,8 @@
|
||||
</ion-buttons>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
<ion-label (click)="asyncNotification()">{{notificationdata.length}} novas notificações</ion-label>
|
||||
<ion-label (click)="asyncNotification()" *ngIf="notificationdata">{{notificationdata.length}} novas notificações</ion-label>
|
||||
<ion-label (click)="asyncNotification()" *ngIf="!notificationdata">0 novas notificações</ion-label>
|
||||
</div>
|
||||
</ion-header>
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ import { MessageModel, DeleteMessageModel } from '../../models/beast-orm';
|
||||
import { WsChatService } from 'src/app/services/chat/ws-chat.service';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
@Component({
|
||||
selector: 'app-login',
|
||||
templateUrl: './login.page.html',
|
||||
@@ -52,6 +53,7 @@ export class LoginPage implements OnInit {
|
||||
private WsChatService: WsChatService,
|
||||
private storage: Storage,
|
||||
public WsChatMethodsService: WsChatMethodsService,
|
||||
private ChatService: ChatService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -130,6 +132,7 @@ export class LoginPage implements OnInit {
|
||||
await this.authService.loginChat(attempt.ChatData.data);
|
||||
|
||||
await this.authService.loginToChatWs();
|
||||
this.ChatService.setheader()
|
||||
|
||||
}
|
||||
|
||||
@@ -156,6 +159,7 @@ export class LoginPage implements OnInit {
|
||||
if(attempt.ChatData) {
|
||||
await this.authService.loginChat(attempt.ChatData.data);
|
||||
await this.authService.loginToChatWs();
|
||||
this.ChatService.setheader()
|
||||
}
|
||||
|
||||
this.getToken();
|
||||
|
||||
@@ -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)
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<div class="title">
|
||||
<ion-label>{{msg.u.name}}</ion-label>
|
||||
<span class="time">{{msg.duration}}</span>
|
||||
{{msg._id}}
|
||||
<!-- {{msg._id}} -->
|
||||
</div>
|
||||
<div class="d-flex justify-space-between">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user