axios请求返回数据中response和{response}解构后的区别
【代码】axios请求返回数据中response和{response}解构后的区别。
·
.then(response)如果这样写
this.axios
.get("http://localhost:8080/emp/list")
.then((response) => {
console.log(response);
}).catch((error) => {
console.log(error);
});

.then({response})如果这样写
this.axios
.get("http://localhost:8080/emp/list")
.then(({response}) => {
console.log(response);
}).catch((error) => {
console.log(error);
});

更多推荐



所有评论(0)