help:
https://blog.csdn.net/justlov.
Test environment 1:ajax with parameter request: name
google
get/post unchanged
foreground: pass name directly (the value can be obtained)
background: the decoding / puzzle effect is consistent
when the parameter name value is requested to the background through the browser ajax request, it is not
application/x-www-form-urlencoded MIME value
the request request value for the browser is application/x-www-form-urlencoded MIME
request 200
personal consideration: inconsistent coding between foreground and background
Front end:
data() {
var name=this.$route.query.name;
$.ajax({
url : "topInfo?name="+name,
contentType: "application/json; charset=utf-8",
type : "POST", //GET
async : false, //false,
//timeout : 5000, //
dataType : "json", //:
success : function(data) {
this.items = data.data;
},
error : function(data) {
alert("!!");
}
})
debugger;
return {
items
}
},
background:
public void moreList() throws Exception
{
if("".equals(name)||name==null){
SessionUtils.outRightJSon(this.response,"--null--");
} else if(name.equals("%E5%91%A8%E8%80%81%E5%B8%88")){
SessionUtils.outRightJSon(this.response,"----");
}
//URLDecoder.decode(name,"UTF-8")
request.setCharacterEncoding("utf-8");
ContentVO listContentVo = topServiceImpl.more(name,5);
SessionUtils.outRightJSon(this.response, listContentVo);
}