mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
uncomented login chat
This commit is contained in:
@@ -29,7 +29,7 @@ export class AuthGuard implements CanActivate {
|
||||
this.router.navigate(['/']);
|
||||
return false
|
||||
} else {
|
||||
//this.authService.loginChat();
|
||||
this.authService.loginChat();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,8 +102,8 @@ export class LoginPage implements OnInit {
|
||||
if (attempt) {
|
||||
if (attempt.UserId == SessionStore.user.UserId) {
|
||||
await this.authService.SetSession(attempt, this.userattempt);
|
||||
// await this.authService.loginChat();
|
||||
// await this.authService.loginToChatWs()
|
||||
await this.authService.loginChat();
|
||||
await this.authService.loginToChatWs()
|
||||
this.getToken();
|
||||
SessionStore.setInativity(true);
|
||||
|
||||
@@ -117,8 +117,8 @@ export class LoginPage implements OnInit {
|
||||
await this.authService.SetSession(attempt, this.userattempt);
|
||||
|
||||
this.changeProfileService.run()
|
||||
// await this.authService.loginChat();
|
||||
// await this.authService.loginToChatWs()
|
||||
await this.authService.loginChat();
|
||||
await this.authService.loginToChatWs()
|
||||
this.getToken();
|
||||
this.router.navigateByUrl('/pin', { replaceUrl: true });
|
||||
}
|
||||
|
||||
@@ -56,9 +56,9 @@ export class AuthService {
|
||||
|
||||
}
|
||||
|
||||
/* if (localStorage.getItem("userChat") != null) {
|
||||
if (localStorage.getItem("userChat") != null) {
|
||||
this.ValidatedUserChat = JSON.parse(localStorage.getItem('userChat'));
|
||||
} */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ export class AuthService {
|
||||
//user: UserForm
|
||||
async loginChat() {
|
||||
|
||||
/* const expirationMinutes = 30;
|
||||
const expirationMinutes = 30;
|
||||
let date = new Date().getTime();
|
||||
let expirationDate = new Date(new Date().getTime() + expirationMinutes*60*1000);
|
||||
|
||||
@@ -135,7 +135,7 @@ export class AuthService {
|
||||
this.presentAlert('Network error');
|
||||
}
|
||||
|
||||
this.autoLoginChat(expirationDate.getTime() - date); */
|
||||
this.autoLoginChat(expirationDate.getTime() - date);
|
||||
}
|
||||
|
||||
async autoLoginChat(expirationDate:number){
|
||||
@@ -145,7 +145,7 @@ export class AuthService {
|
||||
}
|
||||
|
||||
loginToChatWs() {
|
||||
/* setTimeout(()=>{
|
||||
setTimeout(()=>{
|
||||
|
||||
this.WsChatService.connect();
|
||||
this.WsChatService.login().then((message) => {
|
||||
@@ -225,7 +225,7 @@ export class AuthService {
|
||||
return false
|
||||
}
|
||||
};
|
||||
}, 1) */
|
||||
}, 1)
|
||||
}
|
||||
|
||||
autologout(expirationDate:number) {
|
||||
|
||||
@@ -32,13 +32,13 @@ export class ChatService {
|
||||
private storageService:StorageService,
|
||||
)
|
||||
{
|
||||
/* this.loggedUserChat = authService.ValidatedUserChat;
|
||||
this.loggedUserChat = authService.ValidatedUserChat;
|
||||
this.headers = new HttpHeaders();
|
||||
this.headers = this.headers.set('X-User-Id', this.loggedUserChat['data'].userId);
|
||||
this.headers = this.headers.set('X-Auth-Token', this.loggedUserChat['data'].authToken);
|
||||
this.options = {
|
||||
headers: this.headers,
|
||||
}; */
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ export const environment = {
|
||||
production: false,
|
||||
apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/',
|
||||
// apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V5/api/',
|
||||
apiChatUrl: 'https://gpr-dev-01.gabinetedigital.local/api/v1/',
|
||||
apiWsChatUrl: 'ws://gpr-dev-01.gabinetedigital.local/websocket',
|
||||
apiChatUrl: 'https://gabinetedigitalchat.dyndns.info/api/v1/',
|
||||
apiWsChatUrl: 'wss://gabinetedigitalchat.dyndns.info/websocket',
|
||||
//apiChatUrl: 'https://www.tabularium.pt/api/v1/',
|
||||
/* apiChatUrl: 'http://chat.gabinetedigital.local:3000/api/v1/', */
|
||||
domain: 'gabinetedigital.local', //gabinetedigital.local
|
||||
|
||||
Reference in New Issue
Block a user