getRequest() {
var url = window.location.search; //获取url中"?"符后的字串
var theRequest = new Object();
if(url.indexOf("?") != -1) {
var str = url.substr(1);
//alert(str);
strs = str.split("&");
for(var i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);
//获取中文参数转码<span style="font-family: Arial, Helvetica, sans-serif;">decodeURI</span>,(unescape只针对数字,中文乱码)
}
}
return theRequest;
},
xiangqing(){
//通过url取数
var request = new Object();
request = this.getRequest();
var id = request['id'];
axios.get(this.ip + '/xinwen/getzhaopinbyid', {
params: {
id: id
}
}).then(res => {
console.log("招聘详情内容:", res.data.object);
this.zhaopin=res.data.parkingslist[0];
}).catch(function(error) {
console.log(error);
});
},
来源:CSDN
作者:进步者-王东太
链接:https://blog.csdn.net/qq_41557799/article/details/103840155