How to configure axios so that the return value can get data? directly

default request API to obtain the returned result of response

clipboard.png

this requires an additional layer of data:response.data.data, when reading data. Is there a configuration item that allows response to return data, directly without having to get it through response.data?

Mar.04,2021

learn about the axios interceptor.

axios.interceptors.response.use(res => {
  console.log(':', res.config.url, res)
  return res.data
})
Menu