| 1 |
- import{J as t,bf as e,r as s,aO as a,aL as o,aA as n,aG as c,B as i,bp as l,N as r,a8 as d,aw as u,aR as p,br as m,G as g,F as f,aQ as y,av as h,M as w,b8 as H,a2 as v,au as b,aS as C,bm as k,b1 as A,ap as L,C as P,a4 as x,b4 as S,aK as _,a_ as j,ar as T,Y as $,bl as I,be as E,R as D,bh as O,x as W,aq as B,aW as N,aV as R,aY as U,L as K}from"./index-F6_4Jyh4.js";import{u as Y,_ as F}from"./liveChat.GIhP_1Cc.js";import{c as G}from"./index.2vaGpUrt.js";const M=function(e){return Array.isArray(e)?Promise.all(e.map(t=>M.call(this,t))):new Promise(s=>{t().in(this).select(e).boundingClientRect(s).exec()})},z=s({__name:"cwg-dropdown",props:{...{bgColor:{type:String,default:"#fff"},customStyle:{type:Object,default:()=>({})}},menuList:{type:Object,default:()=>["菜单1","菜单2","菜单3"]},menuStyle:{type:Object,default:()=>({})},interspace:{type:[String,Number],default:"10rpx"},showActive:{type:Boolean,default:!1},activeKey:{type:[String,Number],default:""}},emits:["open","close","change","menuClick"],setup(t,{expose:s,emit:C}){const k=t,A=C,L=t=>{if(!k.showActive||!k.activeKey)return!1;return(void 0!==t.key?t.key:void 0!==t.value?t.value:void 0!==t.sysCode?t.sysCode:void 0!==t.type?t.type:"")===k.activeKey},P=a(!1),x=o({width:0,height:0}),S=o({}),_=a(0),j=()=>new Promise(t=>{x.width>0?t(x):v({success:e=>{x.width=e.windowWidth,x.height=e.windowHeight,t(x)},fail:()=>{setTimeout(()=>j().then(t),100)}})}),T=async t=>{t.stopPropagation(),await j();const e=await M(".cwg-dropdown");if(!e)return;Object.assign(S,{transform:"scaleY(1)",visibility:"hidden",top:"-9999px",left:"-9999px",transition:"none"}),await b();const s=await M(".cwg-dropdown-menu-container");if(!s)return Object.keys(S).forEach(t=>delete S[t]),void(S.transform="scaleY(0)");const{width:a}=x,{left:o,right:n,bottom:c}=e;_.value;const i={transition:"transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)",transform:"scaleY(1)",top:"10px"};if(o+s.width<a)i.left="-110px";else{const t=a-n;i.right=`${t>0?t:0}px`}Object.keys(S).forEach(t=>delete S[t]),Object.assign(S,i),P.value=!0,A("open"),A("change",!0)},$=()=>{P.value=!1,Object.keys(S).forEach(t=>delete S[t]),S.transform="scaleY(0)",A("close"),A("change",!1)};return n(()=>{var t;j(),_.value=(t=k.interspace)?(t=String(t)).endsWith("rpx")?e(parseInt(t)):(t.endsWith("px"),parseInt(t)):0}),s({close:$}),(e,s)=>{const a=d;return c(),i(a,null,{default:l(()=>[r(a,{class:"cwg-dropdown",style:u(e.customStyle),onClick:T},{default:l(()=>[p(e.$slots,"default",{},void 0,!0)]),_:3},8,["style"]),r(a,{class:"cwg-dropdown-menu"},{default:l(()=>[r(a,{class:"cwg-dropdown-menu-container",style:u([S]),onClick:s[0]||(s[0]=m(()=>{},["stop"]))},{default:l(()=>[p(e.$slots,"menu",{},()=>[r(a,{class:"menu"},{default:l(()=>[p(e.$slots,"btn",{},void 0,!0),(c(!0),g(f,null,y(t.menuList,(t,e)=>(c(),i(a,{class:h(["menu-item",{active:k.showActive&&L(t)}]),key:e,onClick:s=>(A("menuClick",{value:t,index:e}),void $())},{default:l(()=>[r(a,null,{default:l(()=>[w(H(t.label||t),1)]),_:2},1024)]),_:2},1032,["class","onClick"]))),128))]),_:3})],!0)]),_:3},8,["style"])]),_:3}),r(a,{class:h(["cwg-dropdown-mask",{"cwg-dropdown-mask-show":P.value}]),onClick:m($,["stop"])},null,8,["class"])]),_:3})}}},[["__scopeId","data-v-6014a24f"]]),J=G.Host85,V=["/list","/page","/field/params","/dropdown","/single","/detail"],q="/pages/login/index",Q=I();let X=!1;const Z=(t,e={})=>{const{data:s,statusCode:a}=t;if(200===a){if("arraybuffer"===e.responseType||s instanceof ArrayBuffer)return s;if(401===s.code||600===s.code){if((()=>{const t=$();return t[t.length-1].route})()===q)return Promise.reject({...s,msg:s.message||"登录失败,请重试"});k.value="";return e.ignore401||!1?Promise.reject({...s,code:401}):(X||(X=!0,S({title:"登录已过期,请重新登录",icon:"none"}),setTimeout(()=>{_({url:q,success:()=>{j("logoutToSystem",1),T.set("mode","customer"),Q.setMode("customer"),X=!1},fail:()=>{X=!1}})},1500)),Promise.reject({...s,code:401,message:"登录已过期,请重新登录"}))}return 200===s.code?s:(400===s.code||S({title:s.msg||"请求失败",icon:"none"}),Promise.reject(s))}return S({title:`网络错误: ${a}`,icon:"none"}),Promise.reject(t)},tt=t=>(x(),S({title:"网络异常,请稍后重试",icon:"none"}),Promise.reject(t)),et=t=>{const e=G[t.type||"Host80"]||"",s={...t,url:`${e}${t.url}`,method:t.method||"GET",timeout:6e4},a=(t=>{var e;t.header||(t.header={}),"HostShop"===t.type?A.value&&(t.header["Access-Token"]=`${A.value}`):k.value&&(t.header["Access-Token"]=`${k.value}`);return L.value&&(t.header.Language=`${L.value}`),P.value&&(t.header.CLIENT=`${P.value}`),null==(e=Y().userInfo)||e.cId,String(t.method||"GET").toUpperCase(),t.data={...t.data||{}},t.header["Content-Type"]||(t.header["Content-Type"]="application/json"),t})(s);return new Promise((e,o)=>{V.some(t=>s.url.includes(t)),C({...a,success:s=>{try{const a=Z(s,t);e(a)}catch(a){o(a)}},fail:t=>{const e=tt(t);o(e)}})})},st=(t,e,s={},a={},o=!0)=>new Promise((n,c)=>{try{let i=e;e&&"object"==typeof e&&(i=e.path||e.url||e.tempFilePath||e.filePath||e);const l=`${J}${t}`,r={...a||{}};k.value&&(r["Access-Token"]=`${k.value}`),L.value&&(r.Language=`${L.value}`),P.value&&(r.CLIENT=`${P.value}`),E({url:l,filePath:i,name:"file",header:r,formData:s||{},success:t=>{try{t.data=JSON.parse(t.data||"{}")}catch(s){t.data={}}const e={data:t.data,statusCode:t.statusCode};if(o)try{const t=Z(e);n(t)}catch(a){c(a)}else n(e.data)},fail:t=>{c(tt(t))}})}catch(i){c(i)}}),at=(t,e={},s={},a={})=>{const o="string"==typeof s?{type:s,...a||{}}:s||{};return et({url:t,method:"GET",data:e,...o})},ot=(t,e={},s,a={})=>et({url:t,method:"POST",data:e,type:s,...a}),nt={PushMessageList:(t={})=>ot("/push/message/list",t,"Host80"),CustomLoginInfo:(t={})=>ot("/custom/info",t,"Host80"),switchLanguage:(t={})=>ot("/custom/switch/lang",t,"Host80"),CustomDropdown:(t={})=>ot("/account/dropdown",t,"Host80"),getChartInfo:(t={})=>ot("/index/chart/list",t,"Host80"),transferInfo:(t={})=>ot("/transfer/info",t,"Host04"),TransferApply:(t={})=>ot("/transfer/apply",t,"Host04"),ResetDealPassword:(t={})=>ot("/account/settings/reset/deal/password",t,"Host80"),ResetDealPasswordEmail:(t={})=>ot("/account/deal/password/reset/apply/send/email",t,"Host80"),ChangeLeverageAdd:(t={})=>ot("/account/settings/change/leverage/add",t,"Host80"),ChangeInvestorOassword:(t={})=>ot("/account/settings/change/investor/password/add",t,"Host80"),ChangeDealPassword:(t={})=>ot("/account/settings/change/deal/password/add",t,"Host80"),AccountList:(t={})=>ot("/account/list",t,"Host80"),AccountAllList:(t={})=>ot("/account/all/list",t,"Host80"),AccountApplyAdd:(t={})=>ot("/account/apply/add",t,"Host80"),AccountApplyAddDome:(t={})=>ot("/account/apply/demo/add",t,"Host80"),AccountApplyData:(t={})=>ot("/account/apply/data",t,"Host80"),AccountApplyDataDome:(t={})=>ot("/account/apply/demo/data",t,"Host80"),excludeShowLogin:(t={})=>ot("/account/apply/exclude/show/login/type",t,"Host80"),CustomBankList:(t={})=>ot("/custom/bank/list",t,"Host80"),CustomBankDelete:(t={})=>ot("/custom/bank/delete",t,"Host80"),CustomBankUpdate:(t={})=>ot("/custom/bank/update",t,"Host80"),CustomBankAdd:(t={})=>ot("/custom/bank/add",t,"Host80"),customBankCardVerify:(t={})=>ot("/custom/bank/card/verify",t,"Host80"),customBankCardSendCode:(t={})=>ot("/custom/bank/card/send/code",t,"Host80"),CustomUpdateInfo:(t={})=>ot("/custom/update/info",t,"Host80"),CustomUpdateEmail:(t={})=>ot("/custom/update/email",t,"Host80"),CustomUpdateEmailSendCode:(t={})=>ot("/custom/update/email/send/code",t,"Host80"),CustomFileList:(t={})=>ot("/custom/file/list",t,"Host80"),CustomFileUpload:(t={})=>ot("/custom/file/upload/{type}/{id}",t,"Host80"),CustomFileMobile:(t={})=>at("/custom/file/mobile",t,"Host80"),CustomRecordAccount:(t={})=>ot("/custom/apply/list",t,"Host80"),customNoticeList:(t={})=>ot("/custom/notice/list",t,"Host80"),customNoticeSave:(t={})=>ot("/custom/notice/save",t,"Host80"),customApplyIb:(t={})=>ot("/agent/apply/add",t,"Host80"),customApplyIbStatus:(t={})=>ot("/agent/apply/status",t,"Host80"),reasonsRefusalList:(t={})=>ot("/reasons/refusal/list",t,"Host80"),webPopupList:(t={})=>ot("/web/popup/list",t,"Host80"),walletHistoryList:(t={})=>ot("/custom/wallet/history/search/list",t,"Host80"),walletTransferApply:(t={})=>ot("/custom/transfer/apply",t,"Host04"),standardRebateList:(t={})=>ot("/trade/standard/rebate",t,"Host80"),deleteAccountList:(t={})=>ot("/custom/login/delete/search/list",t,"Host80"),historyList:(t={})=>ot("/trade/histort/search/list",t,"Host80"),getWebsdkLink:(t={})=>ot("/withdraw/getWebsdkLink",t,"Host04"),getWebsdkLink1:(t={})=>ot("/agent/withdraw/getWebsdkLink",t,"Host04"),getWebsdkLink2:(t={})=>ot("/custom/bank/getWebsdkLink",t,"Host80"),DropdownlusActivityOptions:(t={})=>ot("/custom/activity/surplus/account/dropdown",t,"Host80"),getSystemList:(t={})=>ot("/custom/system/config/all/list",t,"Host80"),switchSystem:(t={})=>ot("/custom/system/config/choose",t,"Host80"),demoList:(t={})=>ot("/account/demo/all/list",t,"Host80"),updateNick:(t={})=>ot("/custom/login/update/nick/name",t,"Host80"),tradePosition:(t={})=>ot("/trade/position",t,"Host80"),tradePositionExport:(t={})=>ot("/trade/position/export",t,"Host80"),tradeShardingHistory:(t={})=>ot("/trade/sharding/history",t,"Host80"),tradeHistory:(t={})=>ot("/trade/history",t,"Host80"),tradeShardingHistoryExport:(t={})=>ot("/trade/sharding/history/export",t,"Host80"),customDailyCompare:(t={})=>ot("/index/chart/custom/asset/daily/compare",t,"Host80")},ct=s(D({__name:"cwg-language",props:{iconColor:{type:String,default:"#97A1C0"}},setup(t){const e=a(L),{t:s,locale:o}=O(),n=W(()=>B.map(t=>({label:s(`language.${t}`),type:t})));function u({value:t}){const s=(null==t?void 0:t.type)??t;if(!s)return;o.value=s,L.value=s,e.value=s;const a=K[s]||"zh-Hans";U(a)}return(s,a)=>{const o=N(R("cwg-icon"),F),p=d,m=N(R("cwg-dropdown"),z);return c(),i(p,{class:"cwg-language"},{default:l(()=>[r(m,{"menu-list":n.value,onMenuClick:u,showActive:"",activeKey:e.value},{default:l(()=>[r(p,{class:"pc-header-btn"},{default:l(()=>[r(o,{name:"cwg-lang",color:t.iconColor,size:20},null,8,["color"])]),_:1})]),_:1},8,["menu-list","activeKey"])]),_:1})}}}),[["__scopeId","data-v-ce48b8de"]]),it={login:t=>ot("/custom/login",t),getUserInfo:()=>ot("/custom/info"),getUserSingle:()=>ot("/wasabi/api/merchant/user/single",{}),logout:()=>ot("/custom/logout",{}),forgetPwd:t=>ot("/custom/update/password/send/email",t),accountDropdown:(t={})=>ot("/wasabi/api/account/dropdown",t),updateEmailPassword:(t={})=>ot("/custom/update/login/password",t)};export{ct as C,z as _,it as a,nt as c,at as g,ot as p,st as u};
|