@mpxjs/api-proxy
Advanced tools
Comparing version 2.8.49 to 2.8.58
{ | ||
"name": "@mpxjs/api-proxy", | ||
"version": "2.8.49", | ||
"version": "2.8.58", | ||
"description": "convert miniprogram API at each end", | ||
@@ -42,3 +42,3 @@ "module": "src/index.js", | ||
}, | ||
"gitHead": "b399e81951df7094fb0a494ae877bcf4e6a2985b" | ||
"gitHead": "42e08109b8890516ea12d47598f42e2c0a9f4682" | ||
} |
@@ -42,3 +42,13 @@ import axios from 'axios' | ||
timeout, | ||
cancelToken: source.token | ||
cancelToken: source.token, | ||
transitional: { | ||
// silent JSON parsing mode | ||
// `true` - ignore JSON parsing errors and set response.data to null if parsing failed (old behaviour) | ||
// `false` - throw SyntaxError if JSON parsing failed (Note: responseType must be set to 'json') | ||
silentJSONParsing: true, // default value for the current Axios version | ||
// try to parse the response string as JSON even if `responseType` is not 'json' | ||
forcedJSONParsing: false, | ||
// throw ETIMEDOUT error instead of generic ECONNABORTED on request timeouts | ||
clarifyTimeoutError: false | ||
} | ||
} | ||
@@ -53,3 +63,3 @@ | ||
let data = res.data | ||
if (responseType === 'text' && dataType === 'json') { | ||
if (dataType === 'json' && typeof data === 'string') { | ||
try { | ||
@@ -56,0 +66,0 @@ data = JSON.parse(data) |
@@ -84,3 +84,7 @@ import { webHandleSuccess, webHandleFail, isTabBarPage } from '../../../common/js' | ||
if (router) { | ||
const delta = options.delta || 1 | ||
let delta = options.delta || 1 | ||
const stackLength = router.stack.length | ||
if (stackLength > 1 && delta >= stackLength) { | ||
delta = stackLength - 1 | ||
} | ||
router.__mpxAction = { | ||
@@ -87,0 +91,0 @@ type: 'back', |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
120866
3179