mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
Merge branch 'feature/calendar' into developer
This commit is contained in:
@@ -2,5 +2,6 @@ export class User {
|
|||||||
username: string;
|
username: string;
|
||||||
password: string;
|
password: string;
|
||||||
domainName: string;
|
domainName: string;
|
||||||
BasicAuthKey: string
|
BasicAuthKey: string;
|
||||||
|
UserId?: number;
|
||||||
}
|
}
|
||||||
@@ -35,9 +35,7 @@ export class AuthService {
|
|||||||
|
|
||||||
async login(user: User): Promise<boolean> {
|
async login(user: User): Promise<boolean> {
|
||||||
user.BasicAuthKey = 'Basic ' + btoa(user.username + '@' + user.domainName + ':' + user.password); //conversão em base64 das credenciais inseridas
|
user.BasicAuthKey = 'Basic ' + btoa(user.username + '@' + user.domainName + ':' + user.password); //conversão em base64 das credenciais inseridas
|
||||||
//if(!environment.production){
|
|
||||||
localStorage.setItem('user', JSON.stringify(user) );
|
|
||||||
//}
|
|
||||||
|
|
||||||
const options = { headers: {'Authorization': user.BasicAuthKey }};
|
const options = { headers: {'Authorization': user.BasicAuthKey }};
|
||||||
this.headers = this.headers.set('Authorization',user.BasicAuthKey);
|
this.headers = this.headers.set('Authorization',user.BasicAuthKey);
|
||||||
@@ -52,12 +50,14 @@ export class AuthService {
|
|||||||
result = await this.http.get<boolean>(service, options).toPromise();
|
result = await this.http.get<boolean>(service, options).toPromise();
|
||||||
response = await this.http.post<any>(environment.apiURL + "UserAuthentication/Login", '', this.opts).toPromise();
|
response = await this.http.post<any>(environment.apiURL + "UserAuthentication/Login", '', this.opts).toPromise();
|
||||||
|
|
||||||
console.log(response);
|
|
||||||
|
|
||||||
|
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
this.ValidatedUser = user;
|
this.ValidatedUser = user;
|
||||||
|
|
||||||
|
//if(!environment.production){
|
||||||
|
localStorage.setItem('user', JSON.stringify(Object.assign(user, response) ) );
|
||||||
|
//}
|
||||||
|
|
||||||
this.storageService.store(AuthConnstants.USER, response);
|
this.storageService.store(AuthConnstants.USER, response);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -17,8 +17,6 @@ export class SearchService {
|
|||||||
loggeduser: User;
|
loggeduser: User;
|
||||||
headers: HttpHeaders;
|
headers: HttpHeaders;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
categories= Array;
|
categories= Array;
|
||||||
|
|
||||||
// setup
|
// setup
|
||||||
@@ -55,15 +53,18 @@ export class SearchService {
|
|||||||
|
|
||||||
mostSeachWord(size:string):Observable<any>{
|
mostSeachWord(size:string):Observable<any>{
|
||||||
// Endpoint
|
// Endpoint
|
||||||
const geturl = environment.apiURL + 'search/top';
|
|
||||||
|
let UserId = (this.loggeduser.UserId).toString();
|
||||||
|
|
||||||
|
const geturl = environment.apiURL + 'Processes/GetHitsByUserId';
|
||||||
// store params
|
// store params
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
// set https params
|
// set https params
|
||||||
|
|
||||||
|
params = params.set("userId", UserId);
|
||||||
params = params.set("size", size);
|
params = params.set("size", size);
|
||||||
|
|
||||||
|
const options = {
|
||||||
const options = {
|
|
||||||
headers: this.headers,
|
headers: this.headers,
|
||||||
params: params
|
params: params
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<ion-content>
|
<ion-content>
|
||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
<div class="ion-item-container">
|
<div class="ion-item-container">
|
||||||
<ion-input placeholder="Assunto" [(ngModel)]="postEvent.Subject"></ion-input>
|
<ion-input type="text" placeholder="Assunto" [(ngModel)]="postEvent.Subject"></ion-input>
|
||||||
</div>
|
</div>
|
||||||
<div class="container-div">
|
<div class="container-div">
|
||||||
<div class="ion-item-class-2 d-flex">
|
<div class="ion-item-class-2 d-flex">
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
<ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="ion-input-class flex-grow-1">
|
<div class="ion-input-class flex-grow-1">
|
||||||
<ion-input placeholder="Localização" [(ngModel)]="postEvent.Location"></ion-input>
|
<ion-input type="text" placeholder="Localização" [(ngModel)]="postEvent.Location"></ion-input>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Error messages -->
|
<!-- Error messages -->
|
||||||
|
|||||||
Reference in New Issue
Block a user