import{d as E,N as F,R as T,C as U,r as k,a as B,c as A,o as N,a1 as D,b as u,e as R,f as $,g as s,j as M,w as o,s as y,t as I,A as j,_ as z,F as K}from"./vue.BxlDVA1H.js";import{a6 as L,u as O,a7 as H,T as J,g as Z,m as G,A as Q,H as W,I as V,D as X,e as Y,N as x}from"./index.lP_uh0LI.js";import{a as ee,b as se}from"./api.6lAQLjQc.js";import{a as oe}from"./formatTime.in1fXasu.js";import{M as b}from"./md5.DLPczxzP.js";import{_ as ne}from"./_plugin-vue_export-helper.DlAUqK2U.js";const ae=E({name:"changePwd",setup(){const{t:e}=L.useI18n(),n=O(),{themeConfig:S}=F(n),{userInfos:q}=F(H()),p=T(),_=U(),a=k({isShowPassword:!1,ruleForm:{username:"",password:"",password_regain:""},loading:{signIn:!1}}),d=k({username:[{required:!0,message:"请填写账号",trigger:"blur"}],password:[{required:!0,message:"请填写密码",trigger:"blur"},{validator:(m,r,t)=>{const w=new RegExp("(?=.*[0-9])(?=.*[a-zA-Z]).{8,30}");r===""?t(new Error("请输入密码")):w.test(r)?(a.ruleForm.password!==""&&i.value.validateField("password"),t()):t(new Error("您的密码复杂度太低(密码中必须包含字母、数字)"))},trigger:"blur"}],password_regain:[{required:!0,message:"请填写密码",trigger:"blur"},{validator:(m,r,t)=>{r===""?t(new Error("请再次输入密码")):r!==a.ruleForm.password?t(new Error("两次输入密码不一致!")):t()},trigger:"blur"}]}),i=B(),f=A(()=>oe(new Date)),h=async()=>{window.open(Z(`${G.system}apply_for_trial/`))},l=async()=>{i.value&&await i.value.validate(m=>{m?se({...a.ruleForm,password:b.hashStr(a.ruleForm.password),password_regain:b.hashStr(a.ruleForm.password_regain)}).then(r=>{r.code===2e4&&(S.value.isRequestRoutes?(W(),C()):(Q(),C()))}).catch(r=>{V("登录失败")}):V("请填写登录信息")})},C=()=>{var t,w,P,v;X().getSystemDictionarys();let m=f.value;(t=p.query)!=null&&t.redirect?_.push({path:(w=p.query)==null?void 0:w.redirect,query:Object.keys((P=p.query)==null?void 0:P.params).length>0?JSON.parse((v=p.query)==null?void 0:v.params):""}):_.push("/"),a.loading.signIn=!0;const r=e("message.signInText");Y.success(`${m}，${r}`),x.start()};return N(()=>{a.ruleForm.username=ee.get("username"),J().getSystemConfigs()}),{loginClick:l,loginSuccess:C,state:a,formRef:i,rules:d,applyBtnClick:h,showApply:()=>window.location.href.indexOf("public")!=-1,...D(a)}}}),re={key:0,style:{"text-align":"center"}};function te(e,n,S,q,p,_){const a=u("ele-User"),c=u("el-icon"),g=u("el-input"),d=u("el-form-item"),i=u("ele-Unlock"),f=u("el-button"),h=u("el-form");return $(),R(K,null,[s(h,{ref:"formRef",size:"large",class:"login-content-form",model:e.state.ruleForm,rules:e.rules,onKeyup:z(e.loginClick,["enter"])},{default:o(()=>[s(d,{class:"login-animation1",prop:"username"},{default:o(()=>[s(g,{type:"text",placeholder:e.$t("message.account.accountPlaceholder1"),readonly:"",modelValue:e.ruleForm.username,"onUpdate:modelValue":n[0]||(n[0]=l=>e.ruleForm.username=l),clearable:"",autocomplete:"off"},{prefix:o(()=>[s(c,{class:"el-input__icon"},{default:o(()=>[s(a)]),_:1})]),_:1},8,["placeholder","modelValue"])]),_:1}),s(d,{class:"login-animation2",prop:"password"},{default:o(()=>[s(g,{type:e.isShowPassword?"text":"password",placeholder:e.$t("message.account.accountPlaceholder4"),modelValue:e.ruleForm.password,"onUpdate:modelValue":n[2]||(n[2]=l=>e.ruleForm.password=l)},{prefix:o(()=>[s(c,{class:"el-input__icon"},{default:o(()=>[s(i)]),_:1})]),suffix:o(()=>[y("i",{class:I(["iconfont el-input__icon login-content-password",e.isShowPassword?"icon-yincangmima":"icon-xianshimima"]),onClick:n[1]||(n[1]=l=>e.isShowPassword=!e.isShowPassword)},null,2)]),_:1},8,["type","placeholder","modelValue"])]),_:1}),s(d,{class:"login-animation3",prop:"password_regain"},{default:o(()=>[s(g,{type:e.isShowPassword?"text":"password",placeholder:e.$t("message.account.accountPlaceholder5"),modelValue:e.ruleForm.password_regain,"onUpdate:modelValue":n[4]||(n[4]=l=>e.ruleForm.password_regain=l)},{prefix:o(()=>[s(c,{class:"el-input__icon"},{default:o(()=>[s(i)]),_:1})]),suffix:o(()=>[y("i",{class:I(["iconfont el-input__icon login-content-password",e.isShowPassword?"icon-yincangmima":"icon-xianshimima"]),onClick:n[3]||(n[3]=l=>e.isShowPassword=!e.isShowPassword)},null,2)]),_:1},8,["type","placeholder","modelValue"])]),_:1}),s(d,{class:"login-animation4"},{default:o(()=>[s(f,{type:"primary",class:"login-content-submit",round:"",onClick:e.loginClick,loading:e.loading.signIn},{default:o(()=>[y("span",null,j(e.$t("message.account.accountBtnText")),1)]),_:1},8,["onClick","loading"])]),_:1})]),_:1},8,["model","rules","onKeyup"]),e.showApply()?($(),R("div",re,[s(f,{class:"login-content-apply",link:"",type:"primary",plain:"",round:"",onClick:e.applyBtnClick},{default:o(()=>n[5]||(n[5]=[y("span",null,"申请试用",-1)])),_:1,__:[5]},8,["onClick"])])):M("",!0)],64)}const ge=ne(ae,[["render",te],["__scopeId","data-v-d216de50"]]);export{ge as default};
