function getJSON(url){
let promise=new Promise((resolve,reject)=>{
function handler(){
if(this.readyState!==4){
return;
}
if(this.status===200){
resolve(this.response);
}else{
reject(new Error(this.statusText));
}
}
let xhr=new XMLHttpRequest();
xhr.open('GET',url);
xhr.send();
xhr.onreadystatechange=handler;
})
return promise;
}
getJSON("https://h5.heniw.com/hntv_vote/user/login?name=%E5%90%B4%E5%A4%A7%E5%A4%A7&mobile=13548613745").then(function(data){
console.log(data,1);
}).catch(function(res){
console.log(res);
})
console