ah_jjzhgd_webscreen/api/commonRequest.js

16 lines
476 B
JavaScript
Raw Normal View History

2024-03-25 20:20:02 +08:00
// ajax 请求封装
function ajaxRequest(url, type, data, async, beforeFn, successFn, errorFn, contentType) {
$.ajax({
url: url,
type: type,
headers: {
"authorization": localStorage.getItem("zhgd_token")
},
data: data,
async: async,
beforeSend: beforeFn,
contentType: contentType || "application/x-www-form-urlencoded; charset=utf-8",
success: successFn,
error: errorFn
});
}