sf_web_dist/js/index.dzKnCBpx.js

2 lines
4.8 KiB
JavaScript
Raw Normal View History

2025-07-30 14:39:10 +08:00
import{d as e,bn as a,aN as l,aL as s,m as o,w as n,l as t,O as i,c,a9 as r,a8 as u,aO as d,e as p,g as m,P as v,t as g,aH as f,aQ as h,aR as y,r as _,b7 as b,bo as w,bj as x,F as V,aa as k,ah as z,aK as j,o as K,D as S,am as R,b9 as T,ba as C,a$ as D,bb as E,bp as I,an as L,aq as $,Q as N,ao as U,R as A,b2 as G}from"./index.IG9Kr4U_.js";import{E as H}from"./el-card.POOwNuEg.js";import{_ as O}from"./index.Y0toO1-Z.js";/* empty css */import{a as q,E as B,b as F}from"./el-dropdown.CWX6CRXs.js";import"./dropdown.BYZ3EJNX.js";const Q=e({__name:"index",props:{size:{type:String,required:!1}},setup(e){const f=[{label:"中文",value:a.ZH_CN},{label:"English",value:a.EN}],h=l(),{locale:y,t:_}=s();function b(e){y.value=e,h.changeLanguage(e),d.success(_("langSelect.message.success"))}return(a,l)=>{const s=O,d=F,y=B,_=q;return p(),o(_,{trigger:"click",onCommand:b},{dropdown:n(()=>[i(y,null,{default:n(()=>[(p(),c(u,null,r(f,e=>i(d,{key:e.value,disabled:m(h).language===e.value,command:e.value},{default:n(()=>[v(g(e.label),1)]),_:2},1032,["disabled","command"])),64))]),_:1})]),default:n(()=>[t("div",null,[i(s,{"icon-class":"language",size:e.size},null,8,["size"])])]),_:1})}}}),J={class:"login-container"},M={class:"absolute-lt flex-x-end p-3 w-full"},P={class:"logo"},W=["src"],Z={class:"text-center relative"},X={class:"flex-y-center w-full"},Y={class:"flex-y-center w-full"},ee={class:"flex-y-center w-full"},ae=G(e({__name:"index",setup(e){l();const a=f(),s=h(),r=y(),u=_(s.theme===b.DARK),d=_(!0),G=_(!1),q=_(!1),B=_(w),{height:F}=x(),ae=_(""),le=_({username:"",password:"",google_code:""});const se=V(()=>({})),oe=_("");function ne(){const e="/"+re.value.active;j.push({path:e})}function te(){B.value.validate(e=>{if(e){G.value=!0;const e=function(){let e=le.value;const a=re.value.active;return"payer"===a?e={...le.value,mer_name:le.value.username}:"payee"===a&&(e={...le.value,ms_name:le.value.username}),e}();a.login(e).then(e=>{ne()}).catch(()=>{}).finally(()=>{G.value=!1})}})}const ie=()=>{const e=s.theme===b.DARK?b.LIGHT:b.DARK;s.changeTheme(e)};function ce(e){e instanceof KeyboardEvent&&(q.value=e.getModifierState("CapsLock"))}k(()=>{F.value<600?d.value=!1:d.value=!0});const re=_({active:"",list:[{identity:"other",name:"总后台"},{identity:"payer",name:"商户后台"},{identity:"payee",name:"四方管理后台"}]});z({visible:!1,type:"user-form",width:400,title:"",leftBtnText:"确 定",rightBtnText:""});let ue=JSON.parse(sessionStorage.getItem("loginInfo")||"{}");re.value.active=ue.loginType,ae.value&&ae.value!==re.value.active&&!["other","payee","payer"].includes(re.value.active)&&(localStorage.clear(),j.push({path:"/login",replace:!0})),ae.value=re.value.active;return localStorage.getItem(ae.value+"accessToken")&&ne(),K(()=>{re.value.active}),S(()=>r.path,e=>{e.startsWith("/login/")&&re.value.active}),(e,a)=>{const l=E,s=Q,r=O,d=L,f=I,h=$,y=U,_=w,b=H;return p(),c("div",J,[t("div",M,[i(l,{modelValue:m(u),"onUpdate:modelValue":a[0]||(a[0]=e=>D(u)?u.value=e:null),"inline-prompt":"","active-icon":m(C),"inactive-icon":m(T),onChange:ie},null,8,["modelValue","active-icon","inactive-icon"]),i(s,{class:"ml-2 cursor-pointer"})]),m(re).active?(p(),o(b,{key:0,class:"login-input-container !border-none !bg-transparent !rounded-[4%] w-100 <sm:w-85"},{default:n(()=>[t("div",P,[t("img",{src:m(oe),alt:""},null,8,W)]),t("div",Z,[t("h2",null,g(m(re).list.find(e=>e.identity===m(re).active).name),1)]),i(_,{ref_key:"loginFormRef",ref:B,model:m(le),rules:m(se),class:"login-form"},{default:n(()=>[i(f,{prop:"username"},{default:n(()=>[t("div",X,[i(r,{"icon-class":"user",class:"mx-2"}),i(d,{ref:"username",modelValue:m(le).username,"onUpdate:modelValue":a[1]||(a[1]=e=>m(le).username=e),placeholder:e.$t("login.username"),name:"username",size:"large",class:"h-[48px]"},null,8,["modelValue","placeholder"])])]),_:1}),i(h,{visible:m(q),content:e.$t("login.capsLock"),placement:"right"},{default:n(()=>[i(f,{prop:"password"},{default:n(()=>[t("div",Y,[i(r,{"icon-class":"lock",class:"mx-2"}),i(d,{modelValue:m(le).password,"onUpdate:modelValue":a[2]