21 lines
719 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<script src="../../../lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
function getDate(apiUrl, apiType) {
$.ajax({
url: apiUrl, //请求的url地址
dataType: "json", //返回格式为json
//async: false,//请求是否异步默认为异步这也是ajax重要特性
data: {}, //参数值
type: apiType, //请求方式
success: function (req) {
//请求成功时处理
var result = req;
return result;
},
error: function () {
/*错误信息处理*/
layer.msg("获取该接口:" + Url + " 的数据失败,请检查!");
return false;
},
});
}