航班信息显示转换
This commit is contained in:
@@ -21,20 +21,8 @@ export class HttpClientService {
|
||||
*
|
||||
* @return any
|
||||
*/
|
||||
request(method: string, url: string, options?: {
|
||||
body?: any;
|
||||
headers?: HttpHeaders | {
|
||||
[header: string]: string | string[];
|
||||
};
|
||||
params?: HttpParams | {
|
||||
[param: string]: string | string[];
|
||||
};
|
||||
observe?: HttpObserve;
|
||||
reportProgress?: boolean;
|
||||
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
|
||||
withCredentials?: boolean;
|
||||
}): Observable<any> {
|
||||
return this.commonProcess(this.httpClient.request(method, url, options = {}));
|
||||
request(method: string, url: string, options?): Observable<any> {
|
||||
return this.commonProcess(this.httpClient.request(method, url, options));
|
||||
}
|
||||
|
||||
|
||||
@@ -44,15 +32,8 @@ export class HttpClientService {
|
||||
* @param url
|
||||
* @param options
|
||||
*/
|
||||
delete(url: string, options: {
|
||||
headers?: HttpHeaders | { [header: string]: string | string[] },
|
||||
observe?: HttpObserve,
|
||||
params?: HttpParams | { [param: string]: string | string[] },
|
||||
reportProgress?: boolean,
|
||||
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text',
|
||||
withCredentials?: boolean,
|
||||
} = {}): Observable<any> {
|
||||
return this.commonProcess(this.httpClient.delete(url, options = {}));
|
||||
delete(url: string, options?): Observable<any> {
|
||||
return this.commonProcess(this.httpClient.delete(url, options));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,25 +41,18 @@ export class HttpClientService {
|
||||
* @param url
|
||||
* @param options
|
||||
*/
|
||||
get(url: string,params?:object, options?: {
|
||||
headers?: HttpHeaders | { [header: string]: string | string[] },
|
||||
observe?: HttpObserve,
|
||||
params?: HttpParams | { [param: string]: string | string[] },
|
||||
reportProgress?: boolean,
|
||||
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text',
|
||||
withCredentials?: boolean,
|
||||
} ): Observable<any> {
|
||||
get(url: string, params?: object, options?): Observable<any> {
|
||||
let paramsString = [];
|
||||
url = url + '?'
|
||||
let t = Math.random();
|
||||
if (params&¶ms) {
|
||||
if (params && params) {
|
||||
for (const key in params) {
|
||||
if (params[key] !== '') {
|
||||
paramsString.push([key, params[key]].join('='))
|
||||
}
|
||||
}
|
||||
return this.commonProcess(this.httpClient.get(encodeURI(url + paramsString.join('&') + '&t=' + t), options = {}));
|
||||
}else{
|
||||
} else {
|
||||
return this.commonProcess(this.httpClient.get(url + 't=' + t, options = {}));
|
||||
}
|
||||
}
|
||||
@@ -88,15 +62,8 @@ export class HttpClientService {
|
||||
* @param url
|
||||
* @param options
|
||||
*/
|
||||
head(url: string, options: {
|
||||
headers?: HttpHeaders | { [header: string]: string | string[] },
|
||||
observe?: HttpObserve,
|
||||
params?: HttpParams | { [param: string]: string | string[] },
|
||||
reportProgress?: boolean,
|
||||
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text',
|
||||
withCredentials?: boolean,
|
||||
} = {}): Observable<any> {
|
||||
return this.commonProcess(this.httpClient.head(url, options = {}));
|
||||
head(url: string, options?): Observable<any> {
|
||||
return this.commonProcess(this.httpClient.head(url, options));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,15 +71,8 @@ export class HttpClientService {
|
||||
* @param url
|
||||
* @param options
|
||||
*/
|
||||
options(url: string, options: {
|
||||
headers?: HttpHeaders | { [header: string]: string | string[] },
|
||||
observe?: HttpObserve,
|
||||
params?: HttpParams | { [param: string]: string | string[] },
|
||||
reportProgress?: boolean,
|
||||
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text',
|
||||
withCredentials?: boolean,
|
||||
} = {}): Observable<any> {
|
||||
return this.commonProcess(this.httpClient.options(url, options = {}));
|
||||
options(url: string, options?): Observable<any> {
|
||||
return this.commonProcess(this.httpClient.options(url, options));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,32 +80,19 @@ export class HttpClientService {
|
||||
* @param url
|
||||
* @param options
|
||||
*/
|
||||
patch(url: string, body: any | null, options: {
|
||||
headers?: HttpHeaders | { [header: string]: string | string[] },
|
||||
observe?: HttpObserve,
|
||||
params?: HttpParams | { [param: string]: string | string[] },
|
||||
reportProgress?: boolean,
|
||||
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text',
|
||||
withCredentials?: boolean,
|
||||
} = {}): Observable<any> {
|
||||
return this.commonProcess(this.httpClient.patch(url, body, options = {}));
|
||||
patch(url: string, body, options?): Observable<any> {
|
||||
return this.commonProcess(this.httpClient.patch(url, body, options));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* post
|
||||
* @param url
|
||||
* @param body
|
||||
* @param options
|
||||
*/
|
||||
post(url: string, body: any | null, options: {
|
||||
headers?: HttpHeaders | { [header: string]: string | string[] },
|
||||
observe?: HttpObserve,
|
||||
params?: HttpParams | { [param: string]: string | string[] },
|
||||
reportProgress?: boolean,
|
||||
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text',
|
||||
withCredentials?: boolean,
|
||||
} = {}): Observable<any> {
|
||||
return this.commonProcess(this.httpClient.post(url, body, options = {}));
|
||||
post(url: string, body, options?): Observable<any> {
|
||||
return this.commonProcess(this.httpClient.post(url, body, options));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -153,15 +100,8 @@ export class HttpClientService {
|
||||
* @param url
|
||||
* @param options
|
||||
*/
|
||||
put(url: string, body: any | null, options: {
|
||||
headers?: HttpHeaders | { [header: string]: string | string[] },
|
||||
observe?: HttpObserve,
|
||||
params?: HttpParams | { [param: string]: string | string[] },
|
||||
reportProgress?: boolean,
|
||||
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text',
|
||||
withCredentials?: boolean,
|
||||
} = {}): Observable<any> {
|
||||
return this.commonProcess(this.httpClient.put(url, body, options = {}));
|
||||
put(url: string, body, options?): Observable<any> {
|
||||
return this.commonProcess(this.httpClient.put(url, body, options));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user