| 12 |
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./compliance-CI-XCWoL.js","./vendor-CGwcs8dl.js","./vendor-CXz5Ro9h.css","./ucard-DzXjXT_T.js","./Icon-DpgXtqio.js","./Icon-DZO8EP4W.css","./ucard-hGyPS3vf.css","./i18n-BsPwB3zQ.js","./compliance-CErJb1Bw.css","./unocss-DIHJNZ0P.css","./improve-info-Cb-E9F9N.js","./improve-info-DvKAw5u4.css","./language-BQwadr72.js","./language-DUbZuiWk.css"])))=>i.map(i=>d[i]);
- var We=Object.defineProperty;var Ae=(e,t,s)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var m=(e,t,s)=>Ae(e,typeof t!="symbol"?t+"":t,s);import{d as de,u as fe,c as E,o as v,a as x,b as P,e as L,f as h,I as He,t as q,C as se,g as M,h as B,i as Q,r as g,l as y,j as xe,k as De,s as pe,m as O,n as he,p as qe,q as Be,v as Je,w as Ue,x as ge,y as Fe,z as Me,A as ze,L as je,F as Ge,B as oe,D as G,T as Ke,K as Ve,E as Xe,G as Ye,U as Qe,H as Ze,J as et,M as tt,N as st,O as ot,P as nt,Q as at,R as rt,S as ct,V as it,W as lt,X as ut}from"./vendor-CGwcs8dl.js";import{z as dt,p as ft,v as pt,t as ht,a as gt,m as mt,k as vt,i as yt,d as St,e as wt,f as bt,b as kt,c as _t,g as Tt}from"./i18n-BsPwB3zQ.js";/* empty css */(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))o(n);new MutationObserver(n=>{for(const a of n)if(a.type==="childList")for(const c of a.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&o(c)}).observe(document,{childList:!0,subtree:!0});function s(n){const a={};return n.integrity&&(a.integrity=n.integrity),n.referrerPolicy&&(a.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?a.credentials="include":n.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function o(n){if(n.ep)return;n.ep=!0;const a=s(n);fetch(n.href,a)}})();const Et={class:"page-header"},Lt={class:"header"},It={key:0,class:"back"},Ct=de({__name:"PageHeader",props:{title:{},showBack:{type:Boolean}},setup(e){const t=fe(),s=()=>{t.back()};return(o,n)=>(v(),E("div",Et,[x("div",Lt,[o.showBack?(v(),E("span",It,[L(h(He),{name:"down",class:"back-icon",onClick:s})])):P("",!0),x("span",null,q(o.title),1)])]))}}),me=(e,t)=>{const s=e.__vccOpts||e;for(const[o,n]of t)s[o]=n;return s},$t=me(Ct,[["__scopeId","data-v-0b2df8dc"]]);class Ot{constructor(){m(this,"crypt");m(this,"secret");this.crypt=se,this.secret="Believe in yourself."}encrypt(t){return this.crypt.AES.encrypt(t,this.secret).toString()}decrypt(t){return t==null||t.length===0?"":this.crypt.AES.decrypt(t,this.secret).toString(se.enc.Utf8)}}const C=new Ot;function Nt(e,t){const s=M(e,"",localStorage);return B({get(){return s.value&&C.decrypt(s.value)||t},set(n){s.value=n}})}const S=Nt("user-token",""),$=M("lang","cn",localStorage,{deep:!0,writeDefaults:!0}),N=M("CLIENT","");M("rememberPassword","false");class Rt{constructor(t,s={}){m(this,"ws",null);m(this,"url");m(this,"options");m(this,"reconnectTimer",null);m(this,"heartbeatTimer",null);m(this,"reconnectTimes",0);m(this,"onOpen",t=>{});m(this,"onMessage",t=>{});m(this,"onClose",()=>{});m(this,"onError",t=>{});this.url=t,this.options={reconnect:!0,reconnectInterval:3e3,reconnectMaxTimes:20,heartbeat:!0,heartbeatInterval:1e4,pingMsg:JSON.stringify({type:"ping"}),...s},this.connect()}connect(){this.ws=new WebSocket(this.url),this.ws.onopen=t=>{console.log("WS 连接成功"),this.reconnectTimes=0,this.startHeartbeat(),this.onOpen(t)},this.ws.onmessage=t=>{this.onMessage(t)},this.ws.onerror=t=>{console.log("WS 错误",t),this.onError(t)},this.ws.onclose=()=>{console.log("WS 断开连接"),this.stopHeartbeat(),this.onClose(),this.options.reconnect&&this.reconnect()}}send(t){if(!this.ws||this.ws.readyState!==WebSocket.OPEN){console.warn("WebSocket 未连接,消息未发送");return}this.ws.send(JSON.stringify(t))}startHeartbeat(){this.options.heartbeat&&(this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{var t;((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN&&this.ws.send(this.options.pingMsg)},this.options.heartbeatInterval))}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}reconnect(){if(this.reconnectTimes>=this.options.reconnectMaxTimes){console.log("WebSocket 重连次数已达上限");return}this.reconnectTimes++,console.log(`WS 正在重连... 尝试第 ${this.reconnectTimes} 次`),this.reconnectTimer=setTimeout(()=>{this.connect()},this.options.reconnectInterval)}close(){var t;this.options.reconnect=!1,this.stopHeartbeat(),(t=this.ws)==null||t.close()}}let D=window.location.protocol,R=window.location.host.split(".")[1];const Pt="test";let W,H,J;switch(Pt){case"test":W=D+"//secure."+R+".com",J="wss://ws."+R+".com",H=D+"//ad."+R+".com";break;case"production":W=D+"//secure."+R+".com",J="wss://ws."+R+".com",H=D+"//ad."+R+".com";break;default:W="http://103.171.34.61:8000",H="http://103.171.34.61:8500",J="ws://192.168.0.18:8105",W="https://secure.44a5c8109e4.com/",W="http://192.168.0.18:8000",H="http://192.168.0.18:8500";break}const Z={Host00:W,Host85:H,HostWs:J},Wt=Q("ws",()=>{const e=g("CLOSED"),t=g([]),s=g(y.get("wsCard")||null);let o=null;function n(u){o||u&&(e.value="CONNECTING",o=new Rt(`${Z.HostWs}/webSocket?Access-Token=${S.value}`,{heartbeat:!0,reconnect:!0}),o.onOpen=()=>{e.value="OPEN"},o.onMessage=f=>{let i;try{const r=JSON.parse(f.data);i=JSON.parse(r),i.type==="card"||i.type==="global"?(console.log(i,"<<<<<<<<>>"),s.value=i,y.set("wsCard",i)):(s.value=null,y.remove("wsCard"))}catch(r){i=f.data}t.value.push(i)},o.onClose=()=>{e.value="CLOSED"},o.onError=()=>{e.value="CLOSED"})}function a(u){o==null||o.send(u)}function c(){o==null||o.close(),o=null}function d(u){s.value=u,u?y.set("wsCard",u):(y.remove("wsCard"),s.value=null)}return{status:e,messages:t,wsCard:s,connect:n,send:a,close:c,updateWsCard:d}}),U=Q("globalStore",()=>{const e=xe({globalLoading:!1,routerLoading:!1,requestLoading:!1,fullScreenLoading:!1,ISLocal:!1,ISDEV:!1,ISPRE:!1,ISPROD:!1,isPageSwitching:!1,theme:"light"}),t=c=>{e.theme=c},s=c=>{e.globalLoading=c},o=c=>{e.routerLoading=c},n=c=>{e.requestLoading=c},a=c=>{e.fullScreenLoading=c};return{...De(e),setGlobalLoading:s,setGlobalTheme:t,setRouterLoading:o,setRequestLoading:n,setFullScreenLoading:a}}),K="user",ne="cardList",ae="accountInfo",re=Q("userStore",()=>{const e=g(null),t=g(null),s=g(!1),o=g([]),n=()=>{const r=y.get(K);if(r){const l=C.decrypt(r);l&&(e.value=JSON.parse(l),s.value=!0)}},a=()=>{const r=y.get(ae);if(r){const l=C.decrypt(r);l&&(t.value=JSON.parse(l))}},c=()=>{const r=y.get(ne);if(r){const l=C.decrypt(r);l&&(o.value=JSON.parse(l))}},d=r=>{e.value=r,s.value=!0;const l=C.encrypt(JSON.stringify(r));y.set(K,l)},u=r=>{t.value=r;const l=C.encrypt(JSON.stringify(r));y.set(ae,l)},f=r=>{o.value=r;const l=C.encrypt(JSON.stringify(r));y.set(ne,l)},i=()=>{e.value=null,s.value=!1,S.value="",o.value=[],y.remove(K)};return c(),n(),a(),{userInfo:e,accountInfo:t,isLoggedIn:s,userCard:o,saveUserInfo:d,saveAccountInfo:u,saveUserCard:f,clearUserInfo:i}});function At(e,t){pe({message:e}).then(()=>{window.$$lock=!1}).catch(()=>{})}const{Host85:ce,Host00:ie}=Z;window.axios=O;const Ht={"X-Requested-With":"XMLHttpRequest","Content-Type":"application/json"},I={headers:Ht,timeout:5e3,withCredentials:!1};O.interceptors.request.use(e=>e,e=>Promise.resolve(e.response||e));O.interceptors.response.use(e=>e,e=>{const t={};return t.config=e.config,t.data=null,t.headers=e.config.headers,t.status=e.code,t.statusText=e.msg,t.request=e.request,Promise.resolve(t)});function V(e){return e.status===200||e.status===304?e.data:e.status===401?{code:401,data:e.statusText||e.toString(),msg:"您还没有登录, 或者登录超时!"}:{code:-404,data:e.statusText||e.toString(),msg:"接口返回数据错误"}}function X(e){const t=[0,200,1e3];return U().setRequestLoading(!1),e.code===401||e.code===600?(S.value="",window.$$lock||(window.$$lock=!0,At("当前登录状态已失效, 请重新登录"))):t.includes(Number(e.code))?e.code=200:he(e.msg),e}const ve={post(e,t,s,o=!0){return this.RESTful(e,"post",t,s,o)},post80(e,t,s,o=!0){return this.RESTful80(e,"post",t,s,o)},get(e,t,s,o=!0){return this.RESTful(e,"get",t,s,o)},put(e,t,s,o=!0){return this.RESTful(e,"put",t,s,o)},delete(e,t,s,o=!0){return this.RESTful(e,"delete",t,s,o)},async downFile(e,t="get",s){const o={...I,responseType:"arraybuffer",method:t,url:ce+e};return t==="get"?o.params=s:o.data=s,e.includes("NoTimeout")&&(o.timeout=9999999),await O(o)},async uploadFile(e,t,s,o,n=!0){const a=new FormData;a.append("file",t),s&&Object.keys(s).forEach(f=>{a.append(f,s[f])});const c={...I,headers:{...I.headers,"Content-Type":"multipart/form-data",...o},method:"post",url:ie+e,data:a};S.value&&(c.headers["Access-Token"]=`${S.value}`),$.value&&(c.headers.Language=`${$.value}`),N.value&&(c.headers.CLIENT=`${N.value}`),e.includes("NoTimeout")&&(c.timeout=9999999);const d=await O(c),u=V(d);return n?X(u):u},async RESTful80(e,t="get",s,o,n=!0){const a=await this.$RESTful80(e,t,s,o);return n?X(a):a},async RESTful(e,t="get",s,o,n=!0){const a=await this.$RESTful(e,t,s,o);return n?X(a):a},async $RESTful(e,t="get",s,o){var f,i;const n=U();!n.fullScreenLoading&&!n.requestLoading&&n.setRequestLoading(!0),e=ce+e;const a={...I,headers:{...I.headers,...o},method:t,url:e};S.value&&(a.headers["Access-Token"]=`${S.value}`),$.value&&(a.headers.Language=`${$.value}`),N.value&&(a.headers.CLIENT=`${N.value}`);const d=(i=(f=re().userInfo)==null?void 0:f.customInfo)==null?void 0:i.cId;t==="get"?a.params={...s,cId:d}:a.data={...s,cId:d},e.includes("NoTimeout")&&(a.timeout=9999999);const u=await O(a);return V(u)},async $RESTful80(e,t="get",s,o){var f,i;const n=U();!n.fullScreenLoading&&!n.requestLoading&&n.setRequestLoading(!0),e=ie+e;const a={...I,headers:{...I.headers,...o},method:t,url:e};S.value&&(a.headers["Access-Token"]=`${S.value}`),$.value&&(a.headers.Language=`${$.value}`),N.value&&(a.headers.CLIENT=`${N.value}`);const d=(i=(f=re().userInfo)==null?void 0:f.customInfo)==null?void 0:i.cId;t==="get"?a.params={...s,cId:d}:a.data={...s,cId:d},e.includes("NoTimeout")&&(a.timeout=9999999);const u=await O(a);return V(u)}};window.$$api=ve;const ds=ve;function xt(){const e=qe(),t=e.appContext.config.globalProperties,s=e.type,o=Be(),n=fe(),a=U();return{ctx:t,options:s,route:o,router:n,globalStore:a}}const Dt={class:"wrap"},qt={key:0,class:"full-page-loading"},Bt={class:"loading-text"},Jt={key:2,class:"global-loading"},Ut={key:3,class:"router-loading"},Ft={key:4,class:"request-loading"},Mt={class:"loading-text"},zt={key:5,class:"full-screen-loading"},jt={class:"loading-text"},Gt=de({name:"AppRoot",__name:"App",setup(e){const t=Wt(),{t:s}=Je(),{route:o,globalStore:n}=xt(),{globalLoading:a,routerLoading:c,requestLoading:d,fullScreenLoading:u,theme:f}=Ue(n),i=g(!0),r=g(null),l=g(null),A=g(null),w=g("HomeRouter,ListsRouter,AboutRouter");let b=g("fade"),k=g(o.meta.index);ge(()=>o.fullPath,()=>{const p=o.meta.index;!k.value||p===k.value?b.value="fade":p>k.value?b.value="slide-left":b.value="slide-right",k.value=p});const be=B(()=>["/","/cards","/finance","/mine"].includes(o.path)),ke=B(()=>["/","/cards","/finance","/mine","/login","/improve/info","/compliance"].includes(o.path));function _e(){n.$patch({isPageSwitching:!0})}function Te(){n.$patch({isPageSwitching:!1})}function Ee(p){return p.replace(/\//g,"-")}const Le=B(()=>{const p=o.path;let _=p==="/"?"improve-info1":p.slice(1);return _=Ee(_),_=="improve-info1"?"":s(`${_}.title`)||""}),z=()=>{let p=S.value;if(!p){console.warn("No token available for WebSocket connection");return}p=p.replace(/\+/g,"%2B").replace(/\//g,"%2F").replace(/=/g,"%3D");const _=Z.HostWs+"/webSocket?Access-Token="+p;if(typeof WebSocket=="undefined"){console.error(s("Msg.socket"));return}r.value=new WebSocket(_),r.value.onmessage=Ce,r.value.onopen=Ie,r.value.onerror=$e,r.value.onclose=Oe},Ie=()=>{console.log("✅ cardSocket 已连接"),Ne()},Ce=p=>{const _=JSON.parse(p.data),T=JSON.parse(_);T.type==="card"||T.type==="global"?t.updateWsCard(T):t.updateWsCard({})},$e=()=>{console.warn("❌ cardSocket 错误,尝试重连..."),ee()},Oe=()=>{console.warn("⚠️ cardSocket 已关闭,准备重连..."),j(),ee()},ee=()=>{l.value&&clearTimeout(l.value),l.value=setTimeout(()=>{z()},3e3)},Ne=()=>{j(),A.value=setInterval(()=>{r.value&&r.value.readyState===WebSocket.OPEN&&r.value.send(JSON.stringify({type:"ping"}))},5e4)},j=()=>{A.value&&(clearInterval(A.value),A.value=null)},te=()=>{document.visibilityState==="visible"&&(console.log("👀 页面重新激活,检测 WebSocket 状态..."),(!r.value||r.value.readyState!==WebSocket.OPEN)&&z())};return Fe(async()=>{document.documentElement.classList.toggle("dark",f.value==="dark");try{z()}finally{i.value=!1}document.addEventListener("visibilitychange",te)}),Me(()=>{r.value&&(r.value.close(),r.value=null),j(),l.value&&(clearTimeout(l.value),l.value=null),document.removeEventListener("visibilitychange",te)}),(p,_)=>{const T=je,Re=ze("router-view");return v(),E("div",Dt,[h(i)?(v(),E("div",qt,[L(T,{type:"spinner",size:"32px",color:"var(--main-yellow)"}),x("span",Bt,q(h(s)("common.loading")),1)])):(v(),E(Ge,{key:1},[L($t,{title:h(Le),"show-back":!h(ke)},null,8,["title","show-back"]),L(Re,{class:Ye(["app body",{"is-tab":h(be)}])},{default:oe(({Component:Pe})=>[h(a)?P("",!0):(v(),G(Ke,{key:0,name:h(b),onBeforeEnter:_e,onAfterEnter:Te},{default:oe(()=>[(v(),G(Ve,{include:w.value},[(v(),G(Xe(Pe)))],1032,["include"]))]),_:2},1032,["name"]))]),_:1},8,["class"])],64)),h(a)?(v(),E("div",Jt,[L(T,{type:"spinner",size:"32px",color:"var(--main-yellow)"})])):P("",!0),h(c)?(v(),E("div",Ut,[L(T,{type:"spinner",size:"32px",color:"var(--main-yellow)"})])):P("",!0),h(d)?(v(),E("div",Ft,[L(T,{type:"spinner",size:"32px",color:"var(--main-yellow)"}),x("span",Mt,q(h(s)("common.loading")),1)])):P("",!0),h(u)?(v(),E("div",zt,[L(T,{type:"spinner",size:"32px",color:"var(--main-yellow)"}),x("span",jt,q(h(s)("common.loading")),1)])):P("",!0)])}}}),Kt=me(Gt,[["__scopeId","data-v-598fdf2e"]]);function Vt(e){e.mixin({mounted(){const t=["router-link","keep-alive","transition-group","KeepAlive","BaseTransition","RouterView"],s=this.$options.name;s&&!s.includes("van-")&&!t.includes(s)&&(console.log(`%c[${Qe("","yyyy-mm-dd hh:ii:ss.SSS")}] ${s} Mounted`,"color: green"),window[`$$${Ze(s)}`]=this)},methods:{handleGoUrl(t){window.location.href=t}}})}const Xt={install:Vt};function Yt(e){e.config.globalProperties.$dialog={default:pe,confirm:et},e.config.globalProperties.$toast={default:he,loading:nt,success:ot,fail:st,close:tt}}const Qt={install:Yt},Zt="modulepreload",es=function(e,t){return new URL(e,t).href},le={},Y=function(t,s,o){let n=Promise.resolve();if(s&&s.length>0){let c=function(i){return Promise.all(i.map(r=>Promise.resolve(r).then(l=>({status:"fulfilled",value:l}),l=>({status:"rejected",reason:l}))))};const d=document.getElementsByTagName("link"),u=document.querySelector("meta[property=csp-nonce]"),f=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));n=c(s.map(i=>{if(i=es(i,o),i in le)return;le[i]=!0;const r=i.endsWith(".css"),l=r?'[rel="stylesheet"]':"";if(!!o)for(let b=d.length-1;b>=0;b--){const k=d[b];if(k.href===i&&(!r||k.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${l}`))return;const w=document.createElement("link");if(w.rel=r?"stylesheet":Zt,r||(w.as="script"),w.crossOrigin="",w.href=i,f&&w.setAttribute("nonce",f),document.head.appendChild(w),r)return new Promise((b,k)=>{w.addEventListener("load",b),w.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${i}`)))})}))}function a(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return n.then(c=>{for(const d of c||[])d.status==="rejected"&&a(d.reason);return t().catch(a)})},ue=Object.assign({"../views/compliance.vue":()=>Y(()=>import("./compliance-CI-XCWoL.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),"../views/improve-info.vue":()=>Y(()=>import("./improve-info-Cb-E9F9N.js"),__vite__mapDeps([10,1,2,3,4,5,6,7,11,9]),import.meta.url),"../views/language.vue":()=>Y(()=>import("./language-BQwadr72.js"),__vite__mapDeps([12,4,1,2,5,7,13,9]),import.meta.url)});function ts(){const t=window.location.hash.match(/token=([^&]+)/);return t?t[1]:null}let F=[];Object.keys(ue).forEach(e=>{const t=e.match(/\.\/views(.*)\.vue$/);if(t){const s=t[1].toLowerCase();if(s==="/"||s==="/home")return;F.push({name:s.replace("/",""),path:s==="/improve/info"?"/improve/info":s.replace(/-/g,"/"),component:ue[e]})}return{}});F=F.concat([{path:"/:pathMatch(.*)",redirect:"/improve/info"}]);const ye=at({history:rt(),routes:F}),ss=["/login","/language","/reset/password","/improve/info","/compliance"];ye.beforeEach((e,t,s)=>{const o=ts();o&&(S.value=o),S.value||ss.includes(e.path)?s():s("/login")});const os={cn:Tt,en:_t,ar:kt,fa:bt,es:wt,de:St,id:yt,ko:vt,ms:mt,th:gt,tr:ht,vn:pt,pt:ft,zh:dt},ns=localStorage.getItem("lang")||"cn",Se=ct({legacy:!1,locale:ns,fallbackLocale:"en",messages:os,silentTranslationWarn:!0,silentFallbackWarn:!0,globalInjection:!0});ge($,e=>{Se.global.locale.value=e,localStorage.setItem("lang",e)});const fs=["en","cn","zh","de","es","ar","id","ms","th","vn","ko","pt","fa","tr"],we=it(Kt),as=lt(),rs=ut();we.use(Se).use(as).use(ye).use(rs).use(Qt).use(Xt);we.mount("#app");export{ds as $,me as _,fs as a,Y as b,Z as c,$ as l,Wt as u};
|