vue-axios的使用
//get请求 axios .get("json/getDate.json", { params: { id: 50 } }) .then(res => { console.log(res); }); axios({ method: "get", url: "json/getDate.json", params: { id: 10 } }).then(res => { console.log(res); }); //post请求的格式有 //application/json: //form-data:表单提交(图片上传和文件上传) let filter = { name: "55" }; axios.post("json/postDate.json", filter).then(res => { console.log(res); }); //http://localhost:8080/json/postDate.json?goodname=sun axios({ method: "post", url: "json/postDate.json", data: filter, params: { goodname: "sun" } }).then(res => { console.log(res); }); //form-data请求 let formData = new