axios see an error message in response to a request error.response.message

axios printing error just returns an error, the specific error message does not return json format. Error.response need to format the return.
As shown below:
Here Insert Picture Description

After printing can return error.response follows:
Here Insert Picture Description

tenant_userAdd(data).then(response => {
    console.log(response)
    this.$message.success('提交成功');
 }).catch(error => {
    console.log(error.response.message);
 })
Published 47 original articles · won praise 4 · Views 6661

Guess you like

Origin blog.csdn.net/lifangfang0607/article/details/104014203