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 CHANGED
@@ -1,8 +1,8 @@
1
1
  # Change Log
2
2
  > 所有关于本项目的变化都在该文档里。
3
3
 
4
- **1.8.34 -2024-1-22 @张振宇**
5
- - 作为子应用运行时 路由应该平铺
4
+ **1.8.34 -2024-1-23 @张振宇**
5
+ - 微应用下路由平铺处理
6
6
 
7
7
  **1.8.33 -2024-1-18 @江超**
8
8
  - 获取配置改为openApi方式
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.8.34",
3
+ "version": "1.8.35",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -175,7 +175,18 @@ function loadInterceptors () {
175
175
  // 请求rul
176
176
  const requestUrl = res.config.url
177
177
  if (res.data.data) {
178
- res.data = res.data.data
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