8 lines
1.9 KiB
JavaScript
8 lines
1.9 KiB
JavaScript
import{o as P}from"./chunk-GRAP3YP7.js";import{c as A}from"./chunk-XC6ELVTG.js";import{ia as l}from"./chunk-MYNBMTR4.js";import{ca as c,n as S}from"./chunk-TQQZZJXW.js";import{c as w,d as b}from"./chunk-KBSRU77R.js";import{M as _,N as x,a as C,b as h,ra as O}from"./chunk-GSIHKWLV.js";import{o as n,q as a}from"./chunk-QTLWQ5AJ.js";n();a();O();n();a();n();a();var E=()=>c.ont;n();a();b();var R=()=>w;var m=new Proxy({},{get(e,t){return(l()?E():R())[t]}});n();a();O();function d(e){let t={...e};return Object.keys(t).forEach(r=>{let o=e[r];(_(o)||o===""||x(o))&&delete t[r]}),t}var v=[0],ot=()=>new AbortController,L=()=>Promise.reject(),nt=e=>e?.status===m.STATUS_CODE?.ERR_CANCELED;async function p(e={}){let t=e;if(l()&&(t=await c.global?.interceptorHeaders(e),t.url=`https://${c.global.getApiHostname()}${t.url}`),!S()&&A()&&!l()){t.headers||(t.headers={});let r=P();t.headers.Referer_URL=r.iframe_referrer,r.widget_version&&(t.headers.Widget_version=P().widget_version)}return h(t.params)&&(t.params=d(t.params)),C(t.data)?t.data=t.data.map(r=>d(r)):h(t.data)&&(t.data=d(t.data)),t.needSign=!0,t.customToLogin=L,t}function g(e){return e.then(t=>{let{data:r}=t;return v.includes(r?.code)?r:Promise.reject(r||{})})}var u={};u.get=(e,t)=>g(p({...t,url:e}).then(r=>{let{url:o,...s}=r;return m.get(o,s).then(i=>(i?.status===200&&i?.data?.code&&(i.data.code=+i.data.code),i))}));u.getWithCache=(e,t)=>g(p({...t,url:e}).then(r=>{let{url:o,...s}=r;return m.getWithCache(o,{cacheSeconds:60*5,...s})}));u.post=(e,t,r)=>g(p({...r,url:e,data:t,method:"post"}).then(o=>{let{url:s,data:i,...D}=o;return m.post(s,i,D)}));u.delete=(e,t,r)=>g(p({...r,url:e,data:t,method:"delete"}).then(o=>{let{url:s,...i}=o;return m.delete(s,i)}));var at=u;export{ot as a,nt as b,at as c};
|
|
|
|
window.inOKXExtension = true;
|
|
window.inMiniApp = false;
|
|
window.ASSETS_BUILD_TYPE = "publish";
|
|
|
|
//# sourceMappingURL=chunk-UJIS6BFS.js.map
|