mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
Merge branch 'developer' into developer_mobilefirst
This commit is contained in:
@@ -41,7 +41,8 @@ export class AuthService {
|
||||
|
||||
|
||||
async login(user: UserForm): 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);
|
||||
user.BasicAuthKey = 'Basic ' + btoa(user.username + ':' + user.password); //conversão em base64 das credenciais inseridas
|
||||
|
||||
|
||||
const options = { headers: {'Authorization': user.BasicAuthKey }};
|
||||
@@ -55,12 +56,11 @@ export class AuthService {
|
||||
let response: any;
|
||||
|
||||
try {
|
||||
result = await this.http.get<boolean>(service, options).toPromise();
|
||||
response = await this.http.post<User>(environment.apiURL + "UserAuthentication/Login", '', this.opts).toPromise();
|
||||
|
||||
console.log(response);
|
||||
|
||||
if (result) {
|
||||
if (response) {
|
||||
if( response.RoleID == 100000014) {
|
||||
response.Profile = 'PR'
|
||||
} else if(response.RoleID == 100000011) {
|
||||
@@ -73,11 +73,11 @@ export class AuthService {
|
||||
|
||||
this.storageService.store(AuthConnstants.USER, response);
|
||||
|
||||
return result;
|
||||
return true;
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
return result;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -90,11 +90,6 @@ export class EventsService {
|
||||
|
||||
this.headers = new HttpHeaders();
|
||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* getAllEvents(startdate:string, enddate:string): Observable<Event[]>{
|
||||
@@ -118,15 +113,6 @@ export class EventsService {
|
||||
|
||||
params = params.set("Start", startdate);
|
||||
params = params.set("End", enddate);
|
||||
|
||||
/* switch (this.loggeduser.Profile == 'MDGPR') {
|
||||
case value:
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
} */
|
||||
|
||||
let options = {
|
||||
headers: this.headersPrOficial,
|
||||
@@ -306,6 +292,14 @@ export class EventsService {
|
||||
return this.http.put<Event>(`${puturl}`, event, options)
|
||||
}
|
||||
|
||||
changeAgenda(body:any){
|
||||
const puturl = environment.apiURL + 'Calendar/MoveEvent';
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
};
|
||||
return this.http.post<any>(`${puturl}`, body, options);
|
||||
}
|
||||
|
||||
/* postEvent(event:Event, calendarName:string, sharedagenda:string)
|
||||
{
|
||||
const puturl = environment.apiURL + 'calendar/' + ((sharedagenda != '') ? sharedagenda : 'PostEvent');
|
||||
|
||||
Reference in New Issue
Block a user