Axios
对Ajax的封装。简化代码
<script>
function get() {
// 使用axios进行GET请求
axios.get("http://yapi.smart-xwork.cn/mock/169327/emp/list").then(result => {
console.log(result.data);
});
}
function post() {
// 使用axios进行POST请求
axios.post("http://yapi.smart-xwork.cn/mock/169327/emp/deleteById", { id: "1" }).then(result => {
console.log(result.data);
});
}
</script>
标签:xwork,axios,console,cn,Ajax,result,log
From: https://blog.51cto.com/u_16382144/12036164