import{a as E,aC as F,aB as U,aH as b,_ as k,r as T,f as M,q as N,ag as A,aj as u,c as R,o as V,S as s,M as D,K as o,b as y,G as $,Q as j,a7 as K,R as z}from"./vue.D1BjjNmv.js";import{v as O,u as L,d as G,h as H,f as J,aj as Q,ax as Z,ay as W,am as B,a3 as X,E as Y,N as x}from"./index.CL7yl-Wb.js";import{a as ee}from"./formatTime.in1fXasu.js";import{a as se}from"./api.BWHo6Ng2.js";import{M as I}from"./md5.DLPczxzP.js";import{_ as oe}from"./_plugin-vue_export-helper.DlAUqK2U.js";const ae=E({name:"changePwd",setup(){const{t:e}=O.useI18n(),a=L(),{themeConfig:S}=F(a),{userInfos:q}=F(G()),d=U(),h=b(),n=k({isShowPassword:!1,ruleForm:{username:"",password:"",password_regain:""},loading:{signIn:!1}}),p=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)?(n.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!==n.ruleForm.password?t(new Error("两次输入密码不一致!")):t()},trigger:"blur"}]}),i=T(),f=M(()=>ee(new Date)),_=async()=>{window.open(Q("/api/system/apply_for_trial/"))},l=async()=>{i.value&&await i.value.validate(m=>{m?se({...n.ruleForm,password:I.hashStr(n.ruleForm.password),password_regain:I.hashStr(n.ruleForm.password_regain)}).then(r=>{r.code===2e3&&(S.value.isRequestRoutes?(W(),C()):(Z(),C()))}).catch(r=>{B("登录失败")}):B("请填写登录信息")})},C=()=>{var t,w,v,P;X().getSystemDictionarys();let m=f.value;(t=d.query)!=null&&t.redirect?h.push({path:(w=d.query)==null?void 0:w.redirect,query:Object.keys((v=d.query)==null?void 0:v.params).length>0?JSON.parse((P=d.query)==null?void 0:P.params):""}):h.push("/"),n.loading.signIn=!0;const r=e("message.signInText");Y.success(`${m}，${r}`),x.start()};return N(()=>{n.ruleForm.username=H.get("username"),J().getSystemConfigs()}),{loginClick:l,loginSuccess:C,state:n,formRef:i,rules:p,applyBtnClick:_,showApply:()=>window.location.href.indexOf("public")!=-1,...A(n)}}}),ne={key:0,style:{"text-align":"center"}};function re(e,a,S,q,d,h){const n=u("ele-User"),c=u("el-icon"),g=u("el-input"),p=u("el-form-item"),i=u("ele-Unlock"),f=u("el-button"),_=u("el-form");return V(),R(z,null,[s(_,{ref:"formRef",size:"large",class:"login-content-form",model:e.state.ruleForm,rules:e.rules,onKeyup:K(e.loginClick,["enter"])},{default:o(()=>[s(p,{class:"login-animation1",prop:"username"},{default:o(()=>[s(g,{type:"text",placeholder:e.$t("message.account.accountPlaceholder1"),readonly:"",modelValue:e.ruleForm.username,"onUpdate:modelValue":a[0]||(a[0]=l=>e.ruleForm.username=l),clearable:"",autocomplete:"off"},{prefix:o(()=>[s(c,{class:"el-input__icon"},{default:o(()=>[s(n)]),_:1})]),_:1},8,["placeholder","modelValue"])]),_:1}),s(p,{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":a[2]||(a[2]=l=>e.ruleForm.password=l)},{prefix:o(()=>[s(c,{class:"el-input__icon"},{default:o(()=>[s(i)]),_:1})]),suffix:o(()=>[y("i",{class:$(["iconfont el-input__icon login-content-password",e.isShowPassword?"icon-yincangmima":"icon-xianshimima"]),onClick:a[1]||(a[1]=l=>e.isShowPassword=!e.isShowPassword)},null,2)]),_:1},8,["type","placeholder","modelValue"])]),_:1}),s(p,{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":a[4]||(a[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:$(["iconfont el-input__icon login-content-password",e.isShowPassword?"icon-yincangmima":"icon-xianshimima"]),onClick:a[3]||(a[3]=l=>e.isShowPassword=!e.isShowPassword)},null,2)]),_:1},8,["type","placeholder","modelValue"])]),_:1}),s(p,{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()?(V(),R("div",ne,[s(f,{class:"login-content-apply",link:"",type:"primary",plain:"",round:"",onClick:e.applyBtnClick},{default:o(()=>a[5]||(a[5]=[y("span",null,"申请试用",-1)])),_:1},8,["onClick"])])):D("",!0)],64)}const ce=oe(ae,[["render",re],["__scopeId","data-v-15827e38"]]);export{ce as default};
