Mockjs wraps the data I want with another layer.

for example, the return I want is

{
  a: 1
}

the data returned after using mockjs is

{
  config: ...,
  data: {
    a: 1
  },
  headers: ...,
  status: ...
}

what I can make mockjs direct against me is the format I configured, not another layer of data I need.

=

update question: axios has a layer of package, how to get rid of it.

=


you should use axios

.

axios automatically gives the returned packet a layer


the outer layer of your bread is not wrapped by mockjs , is it

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb02f5-22b6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb02f5-22b6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?