@mpxjs/api-proxy 2.9.38 → 2.9.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/common/js/utils.js +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpxjs/api-proxy",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.39",
|
|
4
4
|
"description": "convert miniprogram API at each end",
|
|
5
5
|
"module": "src/index.js",
|
|
6
6
|
"types": "@types/index.d.ts",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"axios": "^1.6.7"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "87957d360b18806f16d169612d924d383ac043c4"
|
|
43
43
|
}
|
package/src/common/js/utils.js
CHANGED
|
@@ -79,6 +79,7 @@ function warn (msg) {
|
|
|
79
79
|
function error (msg) {
|
|
80
80
|
console.error && console.error(`[@mpxjs/api-proxy error]:\n ${msg}`)
|
|
81
81
|
}
|
|
82
|
+
|
|
82
83
|
function envError (method) {
|
|
83
84
|
return () => {
|
|
84
85
|
console.error && console.error(`[@mpxjs/api-proxy error]:\n ${__mpx_mode__}环境不支持${method}方法`)
|
|
@@ -99,7 +100,11 @@ function parseDataset (dataset) {
|
|
|
99
100
|
const parsed = {}
|
|
100
101
|
for (const key in dataset) {
|
|
101
102
|
if (hasOwn(dataset, key)) {
|
|
102
|
-
|
|
103
|
+
try {
|
|
104
|
+
parsed[key] = JSON.parse(dataset[key])
|
|
105
|
+
} catch (e) {
|
|
106
|
+
parsed[key] = dataset[key]
|
|
107
|
+
}
|
|
103
108
|
}
|
|
104
109
|
}
|
|
105
110
|
return parsed
|