vue2-client 1.8.34 → 1.8.35
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/CHANGELOG.md +2 -2
- package/package.json +1 -1
- package/src/utils/request.js +12 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/utils/request.js
CHANGED
|
@@ -175,7 +175,18 @@ function loadInterceptors () {
|
|
|
175
175
|
// 请求rul
|
|
176
176
|
const requestUrl = res.config.url
|
|
177
177
|
if (res.data.data) {
|
|
178
|
-
|
|
178
|
+
let isJsonArray = false
|
|
179
|
+
if (typeof res.data.data === 'string') {
|
|
180
|
+
try {
|
|
181
|
+
const parsedData = JSON.parse(res.data.data)
|
|
182
|
+
isJsonArray = Array.isArray(parsedData)
|
|
183
|
+
} catch (e) {
|
|
184
|
+
isJsonArray = false
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
if (!(Array.isArray(res.data.data) || isJsonArray)) {
|
|
188
|
+
res.data = res.data.data
|
|
189
|
+
}
|
|
179
190
|
}
|
|
180
191
|
// 未设置状态码则默认成功状态
|
|
181
192
|
const code = res.data.code || 200
|