需要格式化一下
this.$http({ method: "post", url: "/chinacountry/index.php/home/Search/index", data: { search: this.search_text //search_i: "2" }, transformRequest: [ function(data) { let ret = ""; for (let it in data) { ret += encodeURIComponent(it) + "=" + encodeURIComponent(data[it]) + "&"; } ret = ret.slice(0, -1); // 去掉最后的空行 return ret; } ], headers: { "Content-Type": "application/x-www-form-urlencoded" } }) .then(response => { console.log(response); }) .catch(error => { console.log(error); });