小程序 封装的fetch header构建一个get函数
This commit is contained in:
parent
381503e494
commit
958679a571
|
|
@ -87,23 +87,21 @@ function packageJsonContent({ name, version, description, cliVersion, cliName, c
|
|||
"react": "^18.2.0",
|
||||
"react-dom": "^18.1.0",
|
||||
"react-image-gallery": "^1.2.11",
|
||||
"react-native": "0.72.7",
|
||||
"react-native-exception-handler": "^2.10.10",
|
||||
"react-native-gesture-handler": "^2.14.0",
|
||||
"react-native-localize": "^3.0.4",
|
||||
"react-native-quick-base64": "^2.0.7",
|
||||
"react-native-quick-crypto": "^0.6.1",
|
||||
"react-native-reanimated": "^3.5.4",
|
||||
"react-native-safe-area-context": "^4.7.4",
|
||||
"react-native-screens": "^3.27.0",
|
||||
"react-native-url-polyfill": "^2.0.0",
|
||||
"react-responsive": "^9.0.0-beta.10",
|
||||
"react-router-dom": "^6.4.0",
|
||||
"react-native": "0.72.7",
|
||||
"react-native-exception-handler": "^2.10.10",
|
||||
"react-native-gesture-handler": "^2.14.0",
|
||||
"react-native-localize": "^3.0.4",
|
||||
"react-native-quick-base64": "^2.0.7",
|
||||
"react-native-quick-crypto": "^0.6.1",
|
||||
"react-native-reanimated": "^3.5.4",
|
||||
"react-native-safe-area-context": "^4.7.4",
|
||||
"react-native-screens": "^3.27.0",
|
||||
"react-native-url-polyfill": "^2.0.0",
|
||||
"react-scripts": "5.0.1",
|
||||
"react-slick": "^0.29.0",
|
||||
"rmc-pull-to-refresh": "^1.0.13",
|
||||
"slick-carousel": "^1.8.1",
|
||||
"url": "^0.11.0",
|
||||
"uuid": "^8.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
@ -141,6 +139,7 @@ function packageJsonContent({ name, version, description, cliVersion, cliName, c
|
|||
"babel-jest": "^27.4.2",
|
||||
"babel-loader": "^8.2.3",
|
||||
"babel-plugin-named-asset-import": "^0.3.8",
|
||||
"babel-plugin-module-resolver": "^5.0.0",
|
||||
"babel-preset-react-app": "^10.0.1",
|
||||
"bfj": "^7.0.2",
|
||||
"browserify-zlib": "^0.2.0",
|
||||
|
|
|
|||
|
|
@ -94,23 +94,21 @@ export function packageJsonContent({
|
|||
"react": "^18.2.0",
|
||||
"react-dom": "^18.1.0",
|
||||
"react-image-gallery": "^1.2.11",
|
||||
"react-native": "0.72.7",
|
||||
"react-native-exception-handler": "^2.10.10",
|
||||
"react-native-gesture-handler": "^2.14.0",
|
||||
"react-native-localize": "^3.0.4",
|
||||
"react-native-quick-base64": "^2.0.7",
|
||||
"react-native-quick-crypto": "^0.6.1",
|
||||
"react-native-reanimated": "^3.5.4",
|
||||
"react-native-safe-area-context": "^4.7.4",
|
||||
"react-native-screens": "^3.27.0",
|
||||
"react-native-url-polyfill": "^2.0.0",
|
||||
"react-responsive": "^9.0.0-beta.10",
|
||||
"react-router-dom": "^6.4.0",
|
||||
"react-native": "0.72.7",
|
||||
"react-native-exception-handler": "^2.10.10",
|
||||
"react-native-gesture-handler": "^2.14.0",
|
||||
"react-native-localize": "^3.0.4",
|
||||
"react-native-quick-base64": "^2.0.7",
|
||||
"react-native-quick-crypto": "^0.6.1",
|
||||
"react-native-reanimated": "^3.5.4",
|
||||
"react-native-safe-area-context": "^4.7.4",
|
||||
"react-native-screens": "^3.27.0",
|
||||
"react-native-url-polyfill": "^2.0.0",
|
||||
"react-scripts": "5.0.1",
|
||||
"react-slick": "^0.29.0",
|
||||
"rmc-pull-to-refresh": "^1.0.13",
|
||||
"slick-carousel": "^1.8.1",
|
||||
"url": "^0.11.0",
|
||||
"uuid": "^8.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
@ -148,6 +146,7 @@ export function packageJsonContent({
|
|||
"babel-jest": "^27.4.2",
|
||||
"babel-loader": "^8.2.3",
|
||||
"babel-plugin-named-asset-import": "^0.3.8",
|
||||
"babel-plugin-module-resolver": "^5.0.0",
|
||||
"babel-preset-react-app": "^10.0.1",
|
||||
"bfj": "^7.0.2",
|
||||
"browserify-zlib": "^0.2.0",
|
||||
|
|
|
|||
|
|
@ -47,6 +47,9 @@ Object.assign(global, {
|
|||
responseType,
|
||||
success: (res) => {
|
||||
const { statusCode, data, header } = res;
|
||||
header.get = function (key: string) {
|
||||
return this[key] as any;
|
||||
};
|
||||
const result = Object.assign({}, res, {
|
||||
status: statusCode,
|
||||
ok: statusCode === 200,
|
||||
|
|
|
|||
Loading…
Reference in New Issue