import{Z as e,_ as t,f as n,a0 as r,t as a}from"./index-9ce39810.js";const o={channelUserId:(n,r)=>(r&&e(n,r),t(n)),iToken:n=>(n&&e("iToken",n),t("iToken")),channelUniId:(n,r)=>(r&&e(n,r),t(n))};function s(e,t,s="GET",i={}){let c={};return c[n.tokenKey]=n.tokenValue,c.pageType=n.currentPageType,c.iToken=o.iToken(),r(Object.assign({url:n.env.JEEPAY_PAY_BASE_URL+e,data:t,method:s,header:c},i)).then((e=>{let{statusCode:t,data:n}=e,r=n;return 200!=t?Promise.reject(r):0!=r.code?(a(r.msg),Promise.reject(r.msg)):Promise.resolve({bizData:r.data,data:n})})).catch((e=>Promise.reject(e)))}const i={req:s,list:function(e,t){return s(e,t,"GET")},add:function(e,t){return s(e,t,"POST")},getById:function(e,t){return s(`${e}/${t}`,{},"GET")},updateById:function(e,t,n){return s(`${e}/${t}`,n,"PUT")},delById:function(e,t){return s(`${e}/${t}`,{},"DELETE")}};export{i as h,o as m};
