调试JQ版本:1.6
function getAjaxData(type) {
let rst;
$.ajax({
url: apiUrl,
method: 'GET',
dataType: 'json',
async: false,
data: {
type: type
},
})
.done(function(res) {
let thisDate = res.data;
rst = thisDate;
// console.log("ajax success");
})
.fail(function(err) {
// console.log("ajax error");
})
.always(function() {
// console.log("ajax complete");
});
return rst;
}