个人设置开发

This commit is contained in:
liweijin
2018-11-15 18:29:55 +08:00
parent 58eff4ad23
commit ae65e0ae65
17 changed files with 343 additions and 84 deletions
+15 -3
View File
@@ -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&&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{
return this.commonProcess(this.httpClient.get(url + 't=' + t, options = {}));
}
}
/**