diff --git a/frontend/src/app/services/auth/auth.service.ts b/frontend/src/app/services/auth/auth.service.ts index fa68650..2b070eb 100644 --- a/frontend/src/app/services/auth/auth.service.ts +++ b/frontend/src/app/services/auth/auth.service.ts @@ -1,6 +1,7 @@ import { Injectable } from '@angular/core'; import {Observable} from "rxjs"; import {JSdata, MessageService} from "../message/message.service"; +import {environment} from "../../../environments/environment"; @Injectable({ providedIn: 'root' @@ -22,7 +23,7 @@ export class AuthService { } sendAuthentication(login: string, password: string): Observable { - return this.messageService.sendMessage('checkLogin', { + return this.messageService.sendMessage(environment.urlCL,'checkLogin', { 'login': login, 'password': password }); diff --git a/frontend/src/app/services/message/message.service.ts b/frontend/src/app/services/message/message.service.ts index 746899a..13b1560 100644 --- a/frontend/src/app/services/message/message.service.ts +++ b/frontend/src/app/services/message/message.service.ts @@ -1,8 +1,6 @@ import { Injectable } from '@angular/core'; import {HttpClient} from '@angular/common/http'; - import {Observable} from 'rxjs'; -import {environment} from "../../../environments/environment"; export interface JSdata{ status: string; @@ -16,8 +14,8 @@ export interface JSdata{ export class MessageService { constructor(private http: HttpClient) { } - sendMessage(url: string, data: any): Observable { - const CreatURL = environment.urlCL.concat('/').concat(url); + sendMessage(baseurl: string, url: string, data: any): Observable { + const CreatURL = baseurl.concat('/').concat(url); //console.log(CreatURL, data); return this.http.post( CreatURL,