Change messageservice, base url added for different server
This commit is contained in:
parent
3583acfcc5
commit
52c19cee63
2 changed files with 4 additions and 5 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {Observable} from "rxjs";
|
import {Observable} from "rxjs";
|
||||||
import {JSdata, MessageService} from "../message/message.service";
|
import {JSdata, MessageService} from "../message/message.service";
|
||||||
|
import {environment} from "../../../environments/environment";
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
|
|
@ -22,7 +23,7 @@ export class AuthService {
|
||||||
}
|
}
|
||||||
|
|
||||||
sendAuthentication(login: string, password: string): Observable<JSdata> {
|
sendAuthentication(login: string, password: string): Observable<JSdata> {
|
||||||
return this.messageService.sendMessage('checkLogin', {
|
return this.messageService.sendMessage(environment.urlCL,'checkLogin', {
|
||||||
'login': login,
|
'login': login,
|
||||||
'password': password
|
'password': password
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {HttpClient} from '@angular/common/http';
|
import {HttpClient} from '@angular/common/http';
|
||||||
|
|
||||||
import {Observable} from 'rxjs';
|
import {Observable} from 'rxjs';
|
||||||
import {environment} from "../../../environments/environment";
|
|
||||||
|
|
||||||
export interface JSdata{
|
export interface JSdata{
|
||||||
status: string;
|
status: string;
|
||||||
|
|
@ -16,8 +14,8 @@ export interface JSdata{
|
||||||
export class MessageService {
|
export class MessageService {
|
||||||
|
|
||||||
constructor(private http: HttpClient) { }
|
constructor(private http: HttpClient) { }
|
||||||
sendMessage(url: string, data: any): Observable<JSdata> {
|
sendMessage(baseurl: string, url: string, data: any): Observable<JSdata> {
|
||||||
const CreatURL = environment.urlCL.concat('/').concat(url);
|
const CreatURL = baseurl.concat('/').concat(url);
|
||||||
//console.log(CreatURL, data);
|
//console.log(CreatURL, data);
|
||||||
return this.http.post<JSdata>(
|
return this.http.post<JSdata>(
|
||||||
CreatURL,
|
CreatURL,
|
||||||
|
|
|
||||||
Reference in a new issue