mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
save
This commit is contained in:
@@ -34,11 +34,9 @@ export class AuthService {
|
||||
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
private httpService: HttpService,
|
||||
private storageService:StorageService,
|
||||
public alertController: AlertController,
|
||||
private aesencrypt: AESEncrypt,
|
||||
private cookieService: CookieService,
|
||||
private RochetChatConnectorService: RochetChatConnectorService,
|
||||
private router: Router,
|
||||
private NfService:NfService,
|
||||
@@ -96,6 +94,8 @@ export class AuthService {
|
||||
session.Profile = 'MDGPR'
|
||||
} else if(session.RoleID == 99999872) {
|
||||
session.Profile = 'Consultant'
|
||||
} else {
|
||||
session.Profile = 'Unknown'
|
||||
}
|
||||
session.Password = user.password
|
||||
|
||||
@@ -111,14 +111,6 @@ export class AuthService {
|
||||
this.initialsService.getInitials(session.FullName);
|
||||
}
|
||||
|
||||
async loginChat(responseChat?) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
async autoLoginChat(expirationDate:number) {
|
||||
}
|
||||
|
||||
loginToChatWs() {
|
||||
setTimeout(() => {
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ThemeService } from 'src/app/services/theme.service';
|
||||
import { StorageService} from 'src/app/services/storage.service';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -15,7 +17,8 @@ export class BackgroundService {
|
||||
|
||||
constructor(
|
||||
private themeservice: ThemeService,
|
||||
private storageservice: StorageService
|
||||
private storageservice: StorageService,
|
||||
private http: HttpClient,
|
||||
) { }
|
||||
|
||||
online() {
|
||||
@@ -54,18 +57,33 @@ export class BackgroundService {
|
||||
}
|
||||
}
|
||||
|
||||
offline() {
|
||||
document.body.style.setProperty(`--color`, "#ffb703");
|
||||
document.body.style.setProperty(`--color2`, "#ffb703");
|
||||
document.body.style.setProperty(`--color3`, "#ffb703");
|
||||
document.body.style.setProperty(`--color4`, "#ffb703");
|
||||
document.body.style.setProperty(`--color5`, "#ffb703");
|
||||
this.storageservice.store('networkCheckStore','offline');
|
||||
this.callBacks.forEach((e) => {
|
||||
if (e.type == 'Offline') {
|
||||
e.funx()
|
||||
async offline() {
|
||||
|
||||
let opts = {
|
||||
headers: {},
|
||||
}
|
||||
|
||||
try {
|
||||
await this.http.post(environment.apiURL + "UserAuthentication/Login", '', opts).toPromise();
|
||||
} catch (error) {
|
||||
if(error.status != 400) {
|
||||
|
||||
document.body.style.setProperty(`--color`, "#ffb703");
|
||||
document.body.style.setProperty(`--color2`, "#ffb703");
|
||||
document.body.style.setProperty(`--color3`, "#ffb703");
|
||||
document.body.style.setProperty(`--color4`, "#ffb703");
|
||||
document.body.style.setProperty(`--color5`, "#ffb703");
|
||||
this.storageservice.store('networkCheckStore','offline');
|
||||
this.callBacks.forEach((e) => {
|
||||
if (e.type == 'Offline') {
|
||||
e.funx()
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
registerBackService(type: 'Offline' | 'Online' | 'Notification', funx: Function, object = '') {
|
||||
|
||||
@@ -343,7 +343,7 @@ export class ChatService {
|
||||
setheader() {
|
||||
try {
|
||||
|
||||
if (this.p.userPermission(this.p.permissionList.Chat.access)) {
|
||||
if (this.p.userPermission(this.p.permissionList.Chat.access) && SessionStore.user.ChatData) {
|
||||
this.headers = new HttpHeaders();
|
||||
|
||||
if (this.p.userPermission(this.p.permissionList.Chat.access)) {
|
||||
@@ -364,7 +364,7 @@ export class ChatService {
|
||||
|
||||
async refreshtoken() {
|
||||
|
||||
if(this.headers) {
|
||||
if(this.headers && SessionStore.user.ChatData) {
|
||||
this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||
let options = {
|
||||
headers: this.headers
|
||||
|
||||
@@ -576,6 +576,8 @@ export class ChatSystemService {
|
||||
const firstName = capitalizeTxt(roomName.split('.')[0])
|
||||
const lastName = capitalizeTxt(roomName.split('.')[1])
|
||||
return firstName + ' ' + lastName
|
||||
} else if(roomData.name) {
|
||||
return roomData.name
|
||||
} else {
|
||||
return 'Sem nome'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user