فهرست منبع

url api remove

formation 3 سال پیش
والد
کامیت
f08fe8cb85
1فایلهای تغییر یافته به همراه6 افزوده شده و 6 حذف شده
  1. 6 6
      angular-client/src/app/services/auth.service.ts

+ 6 - 6
angular-client/src/app/services/auth.service.ts

@@ -58,7 +58,7 @@ export class AuthService {
      //debugger;
     console.log("url ========",this.apiUrl);
 
-    return this.http.post<Token>(`${this.apiUrl}/api/auth/login`, credentials)
+    return this.http.post<Token>(`/api/auth/login`, credentials)
       .pipe(map(token => {
         // store jwt token in local storage 
         localStorage.setItem('token', JSON.stringify(token));
@@ -83,7 +83,7 @@ export class AuthService {
        //debugger;
       console.log("url ========",this.apiUrl);
   
-      return this.http.post<Token>(`${this.apiUrl}/api/auth/admin`, credentials)
+      return this.http.post<Token>(`/api/auth/admin`, credentials)
         .pipe(map(token => {
           // store jwt token in local storage 
           localStorage.setItem('token', JSON.stringify(token));
@@ -97,7 +97,7 @@ export class AuthService {
   // iscription get  token on login 
   signUP(data): Observable<Token> {
 
-    return this.http.post<Token>(`${this.apiUrl}/api/auth/signup`, data)
+    return this.http.post<Token>(`/api/auth/signup`, data)
       .pipe(map(token => {
         // store jwt token in local storage 
         localStorage.setItem('token', JSON.stringify(token));
@@ -110,13 +110,13 @@ export class AuthService {
 
 // mot de passe oublie 
 lostPassword(email): Observable<any> {
-  return this.http.put<any>(`${this.apiUrl}/api/auth/forgot-password`, email)
+  return this.http.put<any>(`/api/auth/forgot-password`, email)
 }
 
 
 // réinitialiser mot de passe  
 resetPassword(data): Observable<any> {
-  return this.http.put<any>(`${this.apiUrl}/api/auth/reset-password`, data)
+  return this.http.put<any>(`/api/auth/reset-password`, data)
 }
 
   // isLoggedIn
@@ -139,7 +139,7 @@ resetPassword(data): Observable<any> {
   getUserInfo(): Observable<User> {
     
     let decodedToken : payloadToken = jwt_decode(this.tokenSubject.value.token); 
-    return this.http.get<User>(`${this.apiUrl}/api/users/${decodedToken.userId}`)
+    return this.http.get<User>(`/api/users/${decodedToken.userId}`)
       .pipe(map(user => {
         // store user info in local storage 
         localStorage.setItem('user', JSON.stringify(user));