So let’s do a demo

Snapshots of data whose back-end type is Array

Snapshots of data whose back-end type is Object

The output of both array and object is the same, so why does the front end always say that the returned data is in the wrong format ?????

  • If input is direct, the data will be converted to a string
  • But the front side of the acquired data, if it is array | object types, to handle will have trouble (back-end: yao returns json!!!)

Let’s see what the types of these two pictures look like.

Figure 1 (Array)

Figure 2 (Object)

In conclusion, there is no difference between the two in terms of data, and JSON can be parsed normally. But, actually. There can be two types of data: array and objectCopy the code

Screenshot of back-end code