fetch(url, {
method: 'post',
headers: {
'Content-type': 'application/x-www-form-urlencoded; charset=UTF-8', //设置表单提交的编码方式,php那边才能用$_POST获取数据
'X-CSRF-TOKEN': $('meta[name=\'csrf_token\']').attr('content')
},
body: 'inajax=1&uniStr=' + ext.info.uniStr,
credentials: 'include'
}).then(function (res) {
if (res.status === 200) {
res.text().then(function (responseText) {
var objRet = $.parseJSON(responseText);
if (objRet.code === '0' && objRet.data) {
//解析接口返回的数据
}
});
} else {
$('#loading').hide();
window.loading = 1;
}
console.log('nextpage is--' + currentPage);
}, function (error) {
$('#loading').hide();
window.loading = 1;
});