mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Add "new-group" and "contacts" pages
- Style new group page - Improve style in chat page
This commit is contained in:
@@ -6,6 +6,7 @@ import { HttpService } from './http.service';
|
||||
import { StorageService } from './storage.service';
|
||||
import { HttpClient, HttpHeaderResponse } from '@angular/common/http';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { Storage } from '@ionic/storage';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -19,19 +20,32 @@ export class ChatService {
|
||||
private http:HttpClient,
|
||||
private httpService: HttpService,
|
||||
private authService: AuthService,
|
||||
private storage: Storage,
|
||||
private storageService:StorageService,) {
|
||||
this.headers = new HttpHeaders();
|
||||
this.authService.userData$.subscribe((res:any)=>{
|
||||
|
||||
this.storage.get('user').then((val) => {
|
||||
console.log(JSON.parse(unescape(atob(val))).data.userId);
|
||||
let user = JSON.parse(unescape(atob(val))).data;
|
||||
|
||||
this.headers = this.headers.set('Access-Control-Allow-Origin', 'http://localhost:8100');
|
||||
this.headers = this.headers.set('Access-Control-Allow-Credentials', 'true');
|
||||
this.headers = this.headers.set('Access-Control-Allow-Headers', 'Access-Control-Allow-Origin, Access-Control-Allow-Credentials, Access-Control-Allow-Headers, x-requested-with, Content-Type, X-Auth-Token, X-User-Id, origin, authorization, accept, client-security-token');
|
||||
this.headers = this.headers.set('X-User-Id', user.userId);
|
||||
this.headers = this.headers.set('X-Auth-Token', user.authToken);
|
||||
});
|
||||
|
||||
/* this.authService.userData$.subscribe((res:any)=>{
|
||||
this.headers = this.headers.set('X-User-Id', res.userId);
|
||||
this.headers = this.headers.set('X-Auth-Token', res.authToken);
|
||||
});
|
||||
}); */
|
||||
this.options = {
|
||||
headers: this.headers,
|
||||
};
|
||||
}
|
||||
|
||||
getAllUsers(){
|
||||
/* console.log(this.headers); */
|
||||
console.log(this.headers);
|
||||
return this.http.get(environment.apiChatUrl+'users.list', this.options);
|
||||
}
|
||||
getAllConnectedUsers(){
|
||||
|
||||
Reference in New Issue
Block a user