import{k as e}from"./index-DyGp0ug8.js";import{s as t}from"./index.Bdpok8sM.js";let o="https://api.wux.shhmkjgs.cn";const n="1.0.5";function s(){return new Promise((e=>{fetch("/static/config.json?t="+Date.now()).then((e=>e.json())).then((t=>{t.BASE_URL&&(o=t.BASE_URL),console.log("[config] loaded BASE_URL:",o),e()})).catch((t=>{console.warn("[config] load failed, using default:",t),e()}))}))}function a(){return o}function i(n,s,a={},i={}){return new Promise(((r,c)=>{let d="App";d="H5";const u={"Content-Type":"application/json",Authorization:`Bearer ${t.token}`,Userid:t.userId,Username:t.userName,"X-Source-Client":"H5"};e({url:o+s,method:n,data:"GET"===n?void 0:a,..."GET"===n?{data:a}:{},header:u,timeout:i.timeout||2e4,success(e){const{code:t,msg:o,data:n}=e.data;r({code:t,msg:o,data:n})},fail(e){c({code:-1,msg:e.errMsg||"网络异常"})}})}))}const r=(e,t,o)=>i("GET",e,t,o),c=(e,t,o)=>i("POST",e,t,o);export{n as A,a,r as g,s as l,c as p};