提交 215f5f54 authored 作者: vipcxj's avatar vipcxj

add: 支持fetch的超时配置

上级 a9926bca
......@@ -43,6 +43,7 @@
"react-native": "^0.49.3",
"react-native-code-push": "^5.1.3-beta",
"react-native-device-info": "^0.12.1",
"react-native-fetch-polyfill": "^1.1.2",
"react-navigation": "^1.0.0-beta.14",
"react-redux": "^5.0.6",
"redux-persist": "^4.10.1"
......
......@@ -6,6 +6,7 @@ import { getToken } from './auth';
import { checkStatus, normParams, parseObject } from './http-helper';
const defaultOptions = {
timeout: 30 * 1000,
headers: { Accept: 'application/json' },
};
......
/* eslint-disable prefer-destructuring */
// noinspection JSUnresolvedVariable
export const fetch = global.fetch;
// eslint-disable-next-line global-require
export const fetch = require('react-native-fetch-polyfill');
......@@ -7,6 +7,7 @@ import { getToken } from './auth';
import { errors } from './error';
const defaultOptions = {
timeout: 30 * 1000,
headers: {
Accept: 'application/json',
},
......
......@@ -6,6 +6,7 @@ import { errors } from './error';
import { checkStatus, normParams, parseObject } from './http-helper';
const defaultOptions = {
timeout: 30 * 1000,
headers: { Accept: 'application/json' },
};
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论