| @@ -36,7 +36,7 @@ export class LoginPage implements OnInit { | |||||
| login() { | login() { | ||||
| this.authService.authenticateUser(this.credentials).then((data: any) => { | this.authService.authenticateUser(this.credentials).then((data: any) => { | ||||
| localStorage.userInfo = data; | |||||
| localStorage.userInfo = JSON.stringify(data); | |||||
| localStorage.access_Token = data.access_Token; | localStorage.access_Token = data.access_Token; | ||||
| this.router.navigate(['/malls']); | this.router.navigate(['/malls']); | ||||
| document.querySelector('.menu-icon-holder').classList.remove('hide'); | document.querySelector('.menu-icon-holder').classList.remove('hide'); | ||||
| @@ -5,12 +5,12 @@ | |||||
| </figure> | </figure> | ||||
| <div class="content"> | <div class="content"> | ||||
| <h5> Mr. Christian Carry | |||||
| <h5> {{ userInfo.name }} | |||||
| <ion-button fill="clear" color="light" size="small"> Edit </ion-button> | <ion-button fill="clear" color="light" size="small"> Edit </ion-button> | ||||
| </h5> | </h5> | ||||
| <ul class="contact"> | <ul class="contact"> | ||||
| <li> +91 0909239302 </li> | |||||
| <li> christian.carry22232@gmail.com </li> | |||||
| <li> {{ userInfo.mobile }} </li> | |||||
| <li> {{ userInfo.email }} </li> | |||||
| </ul> | </ul> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| @@ -9,6 +9,7 @@ import { Router } from '@angular/router'; | |||||
| }) | }) | ||||
| export class ProfilePage implements OnInit { | export class ProfilePage implements OnInit { | ||||
| selected_tab: string = 'MY ORDERS'; | selected_tab: string = 'MY ORDERS'; | ||||
| userInfo: any; | |||||
| constructor( | constructor( | ||||
| private location: Location, | private location: Location, | ||||
| @@ -16,6 +17,8 @@ export class ProfilePage implements OnInit { | |||||
| ) { } | ) { } | ||||
| ngOnInit() { | ngOnInit() { | ||||
| this.userInfo = JSON.parse(localStorage.userInfo)['User Info']; | |||||
| console.log(this.userInfo); | |||||
| } | } | ||||
| ionViewDidEnter() { | ionViewDidEnter() { | ||||
| @@ -17,7 +17,7 @@ export class MallService { | |||||
| headers: new HttpHeaders({ | headers: new HttpHeaders({ | ||||
| 'Access-Control-Allow-Origin': '*', | 'Access-Control-Allow-Origin': '*', | ||||
| 'Content-Type': 'application/json', | 'Content-Type': 'application/json', | ||||
| 'Authorization': 'Token ' + localStorage.access_Token | |||||
| 'Authorization': 'Bearer ' + localStorage.access_Token | |||||
| }) | }) | ||||
| }; | }; | ||||
| @@ -29,7 +29,7 @@ export class MallService { | |||||
| headers: new HttpHeaders({ | headers: new HttpHeaders({ | ||||
| 'Access-Control-Allow-Origin': '*', | 'Access-Control-Allow-Origin': '*', | ||||
| 'Content-Type': 'application/json', | 'Content-Type': 'application/json', | ||||
| 'Authorization': 'Token ' + localStorage.access_Token | |||||
| 'Authorization': 'Bearer ' + localStorage.access_Token | |||||
| }) | }) | ||||
| }; | }; | ||||
| @@ -1,6 +1,6 @@ | |||||
| import { Injectable } from '@angular/core'; | import { Injectable } from '@angular/core'; | ||||
| import { HttpClient, HttpHeaders } from '@angular/common/http'; | import { HttpClient, HttpHeaders } from '@angular/common/http'; | ||||
| import { TOKEN, URL } from '../mocks/url'; | |||||
| import { URL } from '../mocks/url'; | |||||
| @Injectable({ | @Injectable({ | ||||
| providedIn: 'root' | providedIn: 'root' | ||||
| @@ -16,7 +16,7 @@ export class OrderService { | |||||
| headers: new HttpHeaders({ | headers: new HttpHeaders({ | ||||
| 'Access-Control-Allow-Origin': '*', | 'Access-Control-Allow-Origin': '*', | ||||
| 'Content-Type': 'application/json', | 'Content-Type': 'application/json', | ||||
| 'Authorization': 'Token ' + TOKEN | |||||
| 'Authorization': 'Bearer ' + localStorage.access_Token | |||||
| }) | }) | ||||
| }; | }; | ||||
| @@ -28,7 +28,7 @@ export class OrderService { | |||||
| headers: new HttpHeaders({ | headers: new HttpHeaders({ | ||||
| 'Access-Control-Allow-Origin': '*', | 'Access-Control-Allow-Origin': '*', | ||||
| 'Content-Type': 'application/json', | 'Content-Type': 'application/json', | ||||
| 'Authorization': 'Token ' + TOKEN | |||||
| 'Authorization': 'Bearer ' + localStorage.access_Token | |||||
| }) | }) | ||||
| }; | }; | ||||