2 lines
2.6 KiB
JavaScript
2 lines
2.6 KiB
JavaScript
var S=Object.defineProperty;var O=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var h=(e,o,t)=>o in e?S(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,p=(e,o)=>{for(var t in o||(o={}))v.call(o,t)&&h(e,t,o[t]);if(O)for(var t of O(o))w.call(o,t)&&h(e,t,o[t]);return e};var F=(e,o,t)=>new Promise((n,c)=>{var m=s=>{try{u(t.next(s))}catch(R){c(R)}},y=s=>{try{u(t.throw(s))}catch(R){c(R)}},u=s=>s.done?n(s.value):Promise.resolve(s.value).then(m,y);u((t=t.apply(e,o)).next())});import{v as x,f as l,c as T,k as r,a as E,o as C,h as B,t as j}from"./index.203f4f59.js";var a=(e=>(e[e.LOGIN=0]="LOGIN",e[e.REGISTER=1]="REGISTER",e[e.RESET_PASSWORD=2]="RESET_PASSWORD",e[e.MOBILE=3]="MOBILE",e[e.QR_CODE=4]="QR_CODE",e))(a||{});const P=x(0);function G(){function e(n){P.value=n}const o=l(()=>P.value);function t(){e(0)}return{setLoginState:e,getLoginState:o,handleBackLogin:t}}function D(e){function o(){return F(this,null,function*(){const t=r(e);return t?yield t.validate():void 0})}return{validForm:o}}function N(e){const{t:o}=T(),t=l(()=>g(o("sys.login.accountPlaceholder"))),n=l(()=>g(o("sys.login.passwordPlaceholder"))),c=l(()=>g("\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801")),m=l(()=>g(o("sys.login.smsPlaceholder"))),y=l(()=>g(o("sys.login.mobilePlaceholder"))),u=(i,d)=>F(this,null,function*(){return d?Promise.resolve():Promise.reject(o("sys.login.policyPlaceholder"))}),s=i=>(d,f)=>F(this,null,function*(){return f?f!==i?Promise.reject(o("sys.login.diffPwd")):Promise.resolve():Promise.reject(o("sys.login.passwordPlaceholder"))});return{getFormRules:l(()=>{const i=r(t),d=r(n),f=r(c),b=r(m),I=r(y),_={sms:b,mobile:I};switch(r(P)){case 1:return p({account:i,password:d,confirmPassword:[{validator:s(e==null?void 0:e.password),trigger:"change"}],policy:[{validator:u,trigger:"change"}]},_);case 2:return p({account:i},_);case 3:return _;default:return{account:i,password:d,identifyCode:f}}})}}function g(e){return[{required:!0,message:e,trigger:"change"}]}const A={class:"mb-3 text-2xl font-bold text-center xl:text-3xl enter-x xl:text-left"},L=E({__name:"LoginFormTitle",setup(e){const{t:o}=T(),{getLoginState:t}=G(),n=l(()=>({[a.RESET_PASSWORD]:o("sys.login.forgetFormTitle"),[a.LOGIN]:o("sys.login.signInFormTitle"),[a.REGISTER]:o("sys.login.signUpFormTitle"),[a.MOBILE]:o("sys.login.mobileSignInFormTitle"),[a.QR_CODE]:o("sys.login.qrSignInFormTitle")})[r(t)]);return(c,m)=>(C(),B("h2",A,j(r(n)),1))}});var Q=Object.freeze(Object.defineProperty({__proto__:null,default:L},Symbol.toStringTag,{value:"Module"}));export{a as L,L as _,N as a,D as b,Q as c,G as u};
|