sf_web_dist/js/index.CgA-t0RS.js

2 lines
4.7 KiB
JavaScript
Raw Normal View History

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