...
|
...
|
@@ -14,8 +14,15 @@ export default class Request { |
|
|
this.config = process.env.NODE_ENV === `development` ? CONFIG.dev : CONFIG.prd;
|
|
|
|
|
|
this.baseUrl= this.config.baseUrl;
|
|
|
this.privateKey = this.config.privateKey;
|
|
|
this.timeout = this.config.httpTimeout;
|
|
|
|
|
|
this.privateKey = '';
|
|
|
if (React.Platform.OS === 'ios') {
|
|
|
this.privateKey = this.config.iosPrivateKey;
|
|
|
} else {
|
|
|
this.privateKey = this.config.androidPrivateKey;
|
|
|
}
|
|
|
|
|
|
this.timeout = this.config.HTTPTimeout;
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
@@ -133,6 +140,8 @@ export default class Request { |
|
|
reqOpts.body = queryStrigPair;
|
|
|
}
|
|
|
|
|
|
__DEV__ && console.log(this.baseUrl + opts.url);
|
|
|
|
|
|
if (opts.timeout && opts.timeout > 0) {
|
|
|
return await timeoutPromise(opts.timeout, fetch(this.baseUrl + opts.url, reqOpts));
|
|
|
}
|
...
|
...
|
|