个人设置开发
This commit is contained in:
@@ -60,15 +60,27 @@ export class HttpClientService {
|
||||
* @param url
|
||||
* @param options
|
||||
*/
|
||||
get(url: string, 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> {
|
||||
return this.commonProcess(this.httpClient.get(url, options = {}));
|
||||
} ): Observable<any> {
|
||||
let paramsString = [];
|
||||
url = url + '?'
|
||||
let t = Math.random();
|
||||
if (params&¶ms) {
|
||||
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{
|
||||
return this.commonProcess(this.httpClient.get(url + 't=' + t, options = {}));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user