webGoodsSource-dist/js/index.DARpx6d0.js
2025-07-25 10:17:58 +08:00

2 lines
5.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{d as e,bu as a,aV as l,bv as s,m as n,w as o,l as t,N as i,c as u,a8 as c,a7 as r,e as d,g as m,O as p,t as v,bn as g,aQ as f,aW as _,r as h,b9 as y,bw as b,bm as w,F as x,a9 as V,ag as k,aT as z,o as S,b2 as T,D as K,al as C,bb as E,bc as I,a$ as $,bd as j,bx as q,am as D,ap as L,P as N,by as R,an as U,Q as A,b4 as B}from"./index.ZCt2DURL.js";import{E as F}from"./el-card.Dok62ctN.js";import{_ as G}from"./index.DjYEuOl3.js";import{E as H,a as O,b as Q}from"./el-dropdown-item.E55RBPmy.js";const W=e({__name:"index",props:{size:{type:String,required:!1}},setup(e){const f=[{label:"中文",value:a.ZH_CN},{label:"English",value:a.EN}],_=l(),{locale:h,t:y}=s();function b(e){h.value=e,_.changeLanguage(e),g.success(y("langSelect.message.success"))}return(a,l)=>{const s=G,g=Q,h=O,y=H;return d(),n(y,{trigger:"click",onCommand:b},{dropdown:o(()=>[i(h,null,{default:o(()=>[(d(),u(r,null,c(f,e=>i(g,{key:e.value,disabled:m(_).language===e.value,command:e.value},{default:o(()=>[p(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"},Z={class:"flex-y-center w-full"},X={class:"flex-y-center w-full"},Y={class:"flex-y-center w-full"},ee={key:0,class:"google-code-image-box"},ae=B(e({__name:"index",setup(e){l();const a=f(),s=_(),c=T(),r=h(s.theme===y.DARK),g=h(!0),B=h(!1),H=h(!1),O=h(b),{height:Q}=w(),ae=h(""),le=h({user_name:"",password:"",google_code:""}),se=h("");const ne=x(()=>({}));function oe(){const e=c.query.redirect||"/"+ce.value.active;z.push({path:e})}function te(){O.value.validate(e=>{if(e){B.value=!0;const e=function(){let e=le.value;const a=ce.value.active;return"payer"===a?e={...le.value,mer_name:le.value.user_name}:"payee"===a&&(e={...le.value,ms_name:le.value.user_name}),e}();a.login(e).then(e=>{(null==e?void 0:e.qr_code_url)?se.value=null==e?void 0:e.qr_code_url:(se.value="",oe())}).catch(()=>{}).finally(()=>{B.value=!1})}})}h("");const ie=()=>{const e=s.theme===y.DARK?y.LIGHT:y.DARK;s.changeTheme(e)};function ue(e){e instanceof KeyboardEvent&&(H.value=e.getModifierState("CapsLock"))}V(()=>{Q.value<600?g.value=!1:g.value=!0});const ce=h({active:"",list:[{identity:"other",name:"代理商管理平台"},{identity:"payer",name:"商户管理平台"},{identity:"payee",name:"服务商管理平台"},{identity:"supsystem",name:"货源管理后台"}]});k({visible:!1,type:"user-form",width:400,title:"",leftBtnText:"确 定",rightBtnText:""});let re=JSON.parse(sessionStorage.getItem("loginInfo")||"{}");ce.value.active=re.loginType,ae.value&&ae.value!==ce.value.active&&!["other","payee","payer","supsystem"].includes(ce.value.active)&&(localStorage.clear(),z.push({path:"/login",replace:!0})),ae.value=ce.value.active;return localStorage.getItem(ae.value+"accessToken")&&oe(),S(()=>{ce.value.active}),K(()=>c.path,e=>{e.startsWith("/login/")&&ce.value.active}),(e,a)=>{const l=j,s=W,c=G,g=D,f=q,_=L,h=R,y=U,w=b,x=F;return d(),u("div",J,[t("div",M,[i(l,{modelValue:m(r),"onUpdate:modelValue":a[0]||(a[0]=e=>$(r)?r.value=e:null),"inline-prompt":"","active-icon":m(I),"inactive-icon":m(E),onChange:ie},null,8,["modelValue","active-icon","inactive-icon"]),i(s,{class:"ml-2 cursor-pointer"})]),m(ce).active?(d(),n(x,{key:0,class:"login-input-container !border-none !bg-transparent !rounded-[4%] w-100 <sm:w-85"},{default:o(()=>{var l;return[t("div",P,[t("h2",null,v(null==(l=m(ce).list.find(e=>e.identity===m(ce).active))?void 0:l.name),1)]),i(w,{ref_key:"loginFormRef",ref:O,model:m(le),rules:m(ne),class:"login-form"},{default:o(()=>[i(f,{prop:"user_name"},{default:o(()=>[t("div",Z,[i(c,{"icon-class":"user",class:"mx-2"}),i(g,{ref:"user_name",modelValue:m(le).user_name,"onUpdate:modelValue":a[1]||(a[1]=e=>m(le).user_name=e),placeholder:e.$t("login.username"),name:"user_name",size:"large",class:"h-[48px]"},null,8,["modelValue","placeholder"])])]),_:1}),i(_,{visible:m(H),content:e.$t("login.capsLock"),placement:"right"},{default:o(()=>[i(f,{prop:"password"},{default:o(()=>[t("div",X,[i(c,{"icon-class":"lock",class:"mx-2"}),i(g,{modelValue:m(le).password,"onUpdate:modelValue":a[2]||(a[2]=e=>m(le).password=e),placeholder:e.$t("login.password"),type:"password",name:"password",onKeyup:[ue,N(te,["enter"])],size:"large",class:"h-[48px] pr-2","show-password":""},null,8,["modelValue","placeholder"])])]),_:1})]),_:1},8,["visible","content"]),i(f,{prop:"google_code"},{default:o(()=>[t("div",Y,[i(c,{"icon-class":"captcha",class:"mx-2"}),i(g,{modelValue:m(le).google_code,"onUpdate:modelValue":a[3]||(a[3]=e=>m(le).google_code=e),"auto-complete":"off",size:"large",class:"flex-1",placeholder:"Google验证码登录和重置密码首次请勿填写",onKeyup:N(te,["enter"])},null,8,["modelValue"])])]),_:1}),m(se)?(d(),u("div",ee,[i(h,{class:"google-code-image",src:m(se)},null,8,["src"])])):C("",!0),i(y,{loading:m(B),type:"primary",size:"large",class:"w-full",onClick:A(te,["prevent"])},{default:o(()=>[p(v(e.$t("login.login")),1)]),_:1},8,["loading"])]),_:1},8,["model","rules"])]}),_:1})):C("",!0)])}}}),[["__scopeId","data-v-26a43352"]]);export{ae as default};