The latest version of Axios no longer supports jSONP methods. Not wanting to invoke another dependency just because of a JSONP request, axios decided to wrap it itself
Jsonp = (url) => {if(! Url){console.error(' axios.jsonp requires at least one URL argument! ') return; } return new Promise((resolve,reject) => { window.jsonCallBack =(result) => { resolve(result) } var JSONP=document.createElement("script"); JSONP.type="text/javascript"; JSONP.src=`${url}&callback=jsonCallBack`; document.getElementsByTagName("head")[0].appendChild(JSONP); setTimeout(() => { document.getElementsByTagName("head")[0].removeChild(JSONP) },500) }) }Copy the code