Response data cannot be obtained after a successful Vue axios post request

use axios to send post request for background interface

this.$ajax.post("/user/login",{
        username: user,
        password: pass
    })
      .then(function (response) {
        console.log(response)
        console.log(response.data)
      })
      .catch(function (error) {
        console.log(error);
      });

axios filter settings are as follows:

const service = axios.create({
  baseURL: process.env.BASE_API, 
  timeout: 15000 
})

service.interceptors.request.use(config => {
  if (getToken) {
   config.headers["Authorization"] = getToken() 
  }
  return config
}, error => {
  console.log(error)
  Promise.reject(error)
})

if the request is successful, 200

is returned.

clipboard.png

:


reponseresponse.data:

clipboard.png

:

clipboard.png

ask the boss for help, thank you.

Mar.09,2021

problem solved.

my response interceptor intercepted and modified it.


how did you modify


encountered the same problem? how did you solve it?

Menu