user.Bi76YI_Q.js 10 KB

1
  1. import{aG as t,aO as e,_ as s,r as a,ap as o,o as n,i as c,j as i,k as l,l as r,L as d,R as u,q as p,E as m,J as g,K as f,G as y,n as h,t as w,aP as H,P as v,x as k,aQ as C,a as b,aR as A,aS as L,aT as P,A as x,N as S,ao as _,ak as j,a3 as T,a5 as $,aK as I,d as E,u as D,c as O,f as W,g as N,aU as U,aV as B,aW as R}from"./index-BOgQtMw7.js";import{u as K,_ as G}from"./liveChat.DQgcdWzR.js";import{c as F}from"./index.BeoSXJcF.js";const Y=function(e){return Array.isArray(e)?Promise.all(e.map(t=>Y.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 b=t,A=C,L=t=>{if(!b.showActive||!b.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:"")===b.activeKey},P=a(!1),x=o({width:0,height:0}),S=o({}),_=a(0),j=()=>new Promise(t=>{x.width>0?t(x):H({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 Y(".cwg-dropdown");if(!e)return;Object.assign(S,{transform:"scaleY(1)",visibility:"hidden",top:"-9999px",left:"-9999px",transition:"none"}),await v();const s=await Y(".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=b.interspace)?(t=String(t)).endsWith("rpx")?e(parseInt(t)):(t.endsWith("px"),parseInt(t)):0}),s({close:$}),(e,s)=>{const a=k;return c(),i(a,null,{default:l(()=>[r(a,{class:"cwg-dropdown",style:d(e.customStyle),onClick:T},{default:l(()=>[u(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:d([S]),onClick:s[0]||(s[0]=p(()=>{},["stop"]))},{default:l(()=>[u(e.$slots,"menu",{},()=>[r(a,{class:"menu"},{default:l(()=>[u(e.$slots,"btn",{},void 0,!0),(c(!0),m(g,null,f(t.menuList,(t,e)=>(c(),i(a,{class:y(["menu-item",{active:b.showActive&&L(t)}]),key:e,onClick:s=>(A("menuClick",{value:t,index:e}),void $())},{default:l(()=>[r(a,null,{default:l(()=>[h(w(t.label||t),1)]),_:2},1024)]),_:2},1032,["class","onClick"]))),128))]),_:3})],!0)]),_:3},8,["style"])]),_:3}),r(a,{class:y(["cwg-dropdown-mask",{"cwg-dropdown-mask-show":P.value}]),onClick:p($,["stop"])},null,8,["class"])]),_:3})}}},[["__scopeId","data-v-90a174fc"]]),M=F.Host85,J=["/list","/page","/field/params","/dropdown","/single","/detail"],V="/pages/login/index";let q=!1;const Q=(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=I();return t[t.length-1].route})()===V)return Promise.reject({...s,msg:s.message||"登录失败,请重试"});b.value="";return e.ignore401||!1?Promise.reject({...s,code:401}):(q||(q=!0,x({title:"登录已过期,请重新登录",icon:"none"}),setTimeout(()=>{S({url:V,success:()=>{_("logoutToSystem",1),j.set("mode","customer"),q=!1},fail:()=>{q=!1}})},1500)),Promise.reject({...s,code:401,message:"登录已过期,请重新登录"}))}return 200===s.code?s:(400===s.code||x({title:s.msg||"请求失败",icon:"none"}),Promise.reject(s))}return x({title:`网络错误: ${a}`,icon:"none"}),Promise.reject(t)},X=t=>(T(),x({title:"网络异常,请稍后重试",icon:"none"}),Promise.reject(t)),Z=t=>{const e=F[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}`):b.value&&(t.header["Access-Token"]=`${b.value}`);return L.value&&(t.header.Language=`${L.value}`),P.value&&(t.header.CLIENT=`${P.value}`),null==(e=K().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)=>{J.some(t=>s.url.includes(t)),C({...a,success:s=>{try{const a=Q(s,t);e(a)}catch(a){o(a)}},fail:t=>{const e=X(t);o(e)}})})},tt=(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=`${M}${t}`,r={...a||{}};b.value&&(r["Access-Token"]=`${b.value}`),L.value&&(r.Language=`${L.value}`),P.value&&(r.CLIENT=`${P.value}`),$({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=Q(e);n(t)}catch(a){c(a)}else n(e.data)},fail:t=>{c(X(t))}})}catch(i){c(i)}}),et=(t,e={},s={},a={})=>{const o="string"==typeof s?{type:s,...a||{}}:s||{};return Z({url:t,method:"GET",data:e,...o})},st=(t,e={},s,a={})=>Z({url:t,method:"POST",data:e,type:s,...a}),at={PushMessageList:(t={})=>st("/push/message/list",t,"Host80"),CustomLoginInfo:(t={})=>st("/custom/info",t,"Host80"),switchLanguage:(t={})=>st("/custom/switch/lang",t,"Host80"),CustomDropdown:(t={})=>st("/account/dropdown",t,"Host80"),getChartInfo:(t={})=>st("/index/chart/list",t,"Host80"),transferInfo:(t={})=>st("/transfer/info",t,"Host04"),TransferApply:(t={})=>st("/transfer/apply",t,"Host04"),ResetDealPassword:(t={})=>st("/account/settings/reset/deal/password",t,"Host80"),ResetDealPasswordEmail:(t={})=>st("/account/deal/password/reset/apply/send/email",t,"Host80"),ChangeLeverageAdd:(t={})=>st("/account/settings/change/leverage/add",t,"Host80"),ChangeInvestorOassword:(t={})=>st("/account/settings/change/investor/password/add",t,"Host80"),ChangeDealPassword:(t={})=>st("/account/settings/change/deal/password/add",t,"Host80"),AccountList:(t={})=>st("/account/list",t,"Host80"),AccountAllList:(t={})=>st("/account/all/list",t,"Host80"),AccountApplyAdd:(t={})=>st("/account/apply/add",t,"Host80"),AccountApplyAddDome:(t={})=>st("/account/apply/demo/add",t,"Host80"),AccountApplyData:(t={})=>st("/account/apply/data",t,"Host80"),AccountApplyDataDome:(t={})=>st("/account/apply/demo/data",t,"Host80"),excludeShowLogin:(t={})=>st("/account/apply/exclude/show/login/type",t,"Host80"),CustomBankList:(t={})=>st("/custom/bank/list",t,"Host80"),CustomBankDelete:(t={})=>st("/custom/bank/delete",t,"Host80"),CustomBankUpdate:(t={})=>st("/custom/bank/update",t,"Host80"),CustomBankAdd:(t={})=>st("/custom/bank/add",t,"Host80"),customBankCardVerify:(t={})=>st("/custom/bank/card/verify",t,"Host80"),customBankCardSendCode:(t={})=>st("/custom/bank/card/send/code",t,"Host80"),CustomUpdateInfo:(t={})=>st("/custom/update/info",t,"Host80"),CustomUpdateEmail:(t={})=>st("/custom/update/email",t,"Host80"),CustomUpdateEmailSendCode:(t={})=>st("/custom/update/email/send/code",t,"Host80"),CustomFileList:(t={})=>st("/custom/file/list",t,"Host80"),CustomFileUpload:(t={})=>st("/custom/file/upload/{type}/{id}",t,"Host80"),CustomFileMobile:(t={})=>et("/custom/file/mobile",t,"Host80"),CustomRecordAccount:(t={})=>st("/custom/apply/list",t,"Host80"),customNoticeList:(t={})=>st("/custom/notice/list",t,"Host80"),customNoticeSave:(t={})=>st("/custom/notice/save",t,"Host80"),customApplyIb:(t={})=>st("/agent/apply/add",t,"Host80"),customApplyIbStatus:(t={})=>st("/agent/apply/status",t,"Host80"),reasonsRefusalList:(t={})=>st("/reasons/refusal/list",t,"Host80"),webPopupList:(t={})=>st("/web/popup/list",t,"Host80"),walletHistoryList:(t={})=>st("/custom/wallet/history/search/list",t,"Host80"),walletTransferApply:(t={})=>st("/custom/transfer/apply",t,"Host04"),standardRebateList:(t={})=>st("/trade/standard/rebate",t,"Host80"),deleteAccountList:(t={})=>st("/custom/login/delete/search/list",t,"Host80"),historyList:(t={})=>st("/trade/histort/search/list",t,"Host80"),getWebsdkLink:(t={})=>st("/withdraw/getWebsdkLink",t,"Host04"),getWebsdkLink1:(t={})=>st("/agent/withdraw/getWebsdkLink",t,"Host04"),getWebsdkLink2:(t={})=>st("/custom/bank/getWebsdkLink",t,"Host80"),DropdownlusActivityOptions:(t={})=>st("/custom/activity/surplus/account/dropdown",t,"Host80"),getSystemList:(t={})=>st("/custom/system/config/all/list",t,"Host80"),switchSystem:(t={})=>st("/custom/system/config/choose",t,"Host80"),demoList:(t={})=>st("/account/demo/all/list",t,"Host80"),updateNick:(t={})=>st("/custom/login/update/nick/name",t,"Host80"),tradePosition:(t={})=>st("/trade/position",t,"Host80"),tradePositionExport:(t={})=>st("/trade/position/export",t,"Host80"),tradeShardingHistory:(t={})=>st("/trade/sharding/history",t,"Host80"),tradeHistory:(t={})=>st("/trade/history",t,"Host80"),tradeShardingHistoryExport:(t={})=>st("/trade/sharding/history/export",t,"Host80"),customDailyCompare:(t={})=>st("/index/chart/custom/asset/daily/compare",t,"Host80")},ot=s(E({__name:"cwg-language",props:{iconColor:{type:String,default:"#97A1C0"}},setup(t){const e=a(L),{t:s,locale:o}=D(),n=O(()=>U.map(t=>({label:s(`language.${t}`),type:t})));function d({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=R[s]||"zh-Hans";B(a)}return(s,a)=>{const o=W(N("cwg-icon"),G),u=k,p=W(N("cwg-dropdown"),z);return c(),i(u,{class:"cwg-language"},{default:l(()=>[r(p,{"menu-list":n.value,onMenuClick:d,showActive:"",activeKey:e.value},{default:l(()=>[r(u,{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-86e7c77e"]]),nt={login:t=>st("/custom/login",t),getUserInfo:()=>st("/custom/info"),getUserSingle:()=>st("/wasabi/api/merchant/user/single",{}),logout:()=>st("/custom/logout",{}),forgetPwd:t=>st("/custom/update/password/send/email",t),accountDropdown:(t={})=>st("/wasabi/api/account/dropdown",t),updateEmailPassword:(t={})=>st("/custom/update/login/password",t)};export{ot as C,z as _,nt as a,at as c,et as g,st as p,tt as u};