mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
new session service
This commit is contained in:
@@ -19,7 +19,7 @@ import { InitialsService } from './functions/initials.service';
|
||||
import { PermissionService } from './permission.service';
|
||||
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { DocumentManagementStore } from '../store/documentManagement';
|
||||
import { CPSession } from '../store/documentManagement';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -32,8 +32,6 @@ export class AuthService {
|
||||
opts:any;
|
||||
|
||||
tabIsActive = true
|
||||
|
||||
DocumentManagementStore = DocumentManagementStore
|
||||
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
@@ -78,9 +76,6 @@ export class AuthService {
|
||||
async login(user: UserForm, {saveSession = true}): Promise<LoginUserRespose> {
|
||||
user.BasicAuthKey = 'Basic ' + btoa(user.username + ':' + this.aesencrypt.encrypt(user.password,user.username ));
|
||||
|
||||
// Basic peter.maquiran@equilibrium.co.ao:senha123456
|
||||
// console.log(user.BasicAuthKey)
|
||||
|
||||
this.headers = this.headers.set('Authorization', user.BasicAuthKey);
|
||||
this.opts = {
|
||||
headers: this.headers,
|
||||
@@ -119,7 +114,8 @@ export class AuthService {
|
||||
|
||||
if(saveSession) {
|
||||
/* this.SetSession(response, user) */
|
||||
this.DocumentManagementStore.setData(response)
|
||||
console.log('teste', response);
|
||||
CPSession.save(response)
|
||||
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
@@ -882,13 +882,13 @@ export class RoomService {
|
||||
|
||||
private async findMessageInDBByData({localReference, _id}) {
|
||||
|
||||
const a = await MessageModel.filter({localReference: localReference})
|
||||
const a = await MessageModel.filter({localReference: localReference}).execute()
|
||||
if(a.length >= 1) {
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
const c = await MessageModel.filter({_id: _id})
|
||||
const c = await MessageModel.filter({_id: _id}).execute()
|
||||
if(c.length >= 1) {
|
||||
|
||||
return true
|
||||
|
||||
@@ -11,6 +11,7 @@ import { fullTaskList } from '../models/dailyworktask.model';
|
||||
import { ChangeProfileService } from './change-profile.service';
|
||||
import { SessionStore } from '../store/session.service';
|
||||
import { StorageService } from './storage.service';
|
||||
import { CPSession } from '../store/documentManagement';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -42,14 +43,15 @@ export class ProcessesService {
|
||||
|
||||
|
||||
setHeader() {
|
||||
|
||||
console.log('CPSession.AuthorizationJwt', CPSession.AuthorizationJwt);
|
||||
|
||||
this.headers = new HttpHeaders();
|
||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
|
||||
this.headers2 = new HttpHeaders();
|
||||
this.headers2 = this.headers2.set('Authorization',"bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiIyNjIiLCJ1bmlxdWVfbmFtZSI6IkdpbHNvbiBNYW51ZWwiLCJlbWFpbCI6ImdpbHNvbi5tYW51ZWxAZ2FiaW5ldGVkaWdpdGFsLmxvY2FsIiwicm9sZSI6IlNlY3JldMOhcmlvIEdlcmFsIiwiZ3JvdXBzaWQiOiJHYWJpbmV0ZSBkZSBUZWNub2xvZ2lhcyBkZSBJbmZvcm1hw6fDo28iLCJvcmdhbmljZW50aXR5aWREIjoiMTA2IiwibmJmIjoxNjg4NTg0NTYzLCJleHAiOjE3MjAxMjA1NjMsImlhdCI6MTY4ODU4NDU2MywiaXNzIjoiOGIxMzBhN2YwLWM3YjctNDdzMjMtOWE4ZC1kNTlhMDE5YWY3NDkiLCJhdWQiOiJkMjh3dzE0NTMtM2M2OC00MWFkLThiNmMtYTUzNDUzODNlMGMyIn0.QDCrQsCH59GQMoudZTHyCMwwHYVwz1mZkLTzvzAwh64"
|
||||
this.headers2 = this.headers2.set('Authorization',"bearer "+ CPSession.AuthorizationJwt);
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
uploadFile(formData:any){
|
||||
|
||||
Reference in New Issue
Block a user