var HttpUtil = {
ip: "ip",
version: "1.0.0",
//get请求
Get: function (url, reqData, callback,that,temp,temp1) {
var self = this;
url += "?";
for (var item in reqData) {
url += item + "=" + reqData[item] + "&";
}
// console.log(self.ip + url)
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status >= 200 && xhr.status < 400) {
var response = xhr.responseText;
// console.log(response)
if (response) {
var res = JSON.parse(response);
callback(res,that,temp,temp1);
} else {
callback(false);
}
} else {
console.log("请求失败")