Server IP : 150.95.80.236 / Your IP : 3.144.109.223 Web Server : Apache System : Linux host-150-95-80-236 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64 User : social-telecare ( 10000) PHP Version : 7.4.33 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/pcu.in.th/uat.pcu.in.th/demo15/src/plugins/formvalidation/dist/es6/utils/ |
Upload File : |
export default function e(e,t){const n=e=>Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&");return new Promise(((o,s)=>{const d=Object.assign({},{crossDomain:false,headers:{},method:"GET",params:{}},t);const a=Object.keys(d.params).map((e=>`${encodeURIComponent(e)}=${encodeURIComponent(d.params[e])}`)).join("&");const r=e.indexOf("?");const c="GET"===d.method?`${e}${r?"?":"&"}${a}`:e;if(d.crossDomain){const e=document.createElement("script");const t=`___fetch${Date.now()}___`;window[t]=e=>{delete window[t];o(e)};e.src=`${c}${r?"&":"?"}callback=${t}`;e.async=true;e.addEventListener("load",(()=>{e.parentNode.removeChild(e)}));e.addEventListener("error",(()=>s));document.head.appendChild(e)}else{const e=new XMLHttpRequest;e.open(d.method,c);e.setRequestHeader("X-Requested-With","XMLHttpRequest");if("POST"===d.method){e.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}Object.keys(d.headers).forEach((t=>e.setRequestHeader(t,d.headers[t])));e.addEventListener("load",(function(){o(JSON.parse(this.responseText))}));e.addEventListener("error",(()=>s));e.send(n(d.params))}}))}