import{_ as R,a as q,g as P,r as g,e as d,c as _,o as f,i as s,h as n,j as t,E as U,f as z,m as o,Q as B,a5 as w,R as E,n as K,b5 as N,b6 as T}from"./index-D7n5ZNak.js";const M={class:"register"},$={class:"register-code"},I=["src"],j={key:0},A={key:1},F={style:{float:"right"}},H={__name:"register",setup(L){const y=q(),{proxy:v}=P(),r=g({username:"",password:"",confirmPassword:"",code:"",uuid:""}),V={username:[{required:!0,trigger:"blur",message:"请输入您的账号"},{min:2,max:20,message:"用户账号长度必须介于 2 和 20 之间",trigger:"blur"}],password:[{required:!0,trigger:"blur",message:"请输入您的密码"},{min:5,max:20,message:"用户密码长度必须介于 5 和 20 之间",trigger:"blur"},{pattern:/^[^<>"'|\\]+$/,message:`不能包含非法字符：< > " ' \\ |`,trigger:"blur"}],confirmPassword:[{required:!0,trigger:"blur",message:"请再次输入您的密码"},{required:!0,validator:(i,e,a)=>{r.value.password!==e?a(new Error("两次输入的密码不一致")):a()},trigger:"blur"}],code:[{required:!0,trigger:"change",message:"请输入验证码"}]},h=g(""),p=g(!1),b=g(!1);function c(){v.$refs.registerRef.validate(i=>{i&&(p.value=!0,N(r.value).then(e=>{const a=r.value.username;T.alert("<font color='red'>恭喜你，您的账号 "+a+" 注册成功！</font>","系统提示",{dangerouslyUseHTMLString:!0,type:"success"}).then(()=>{y.push("/login")}).catch(()=>{})}).catch(()=>{p.value=!1}))})}return(i,e)=>{const a=B,m=d("el-input"),u=d("el-form-item"),x=d("el-button"),k=d("router-link"),C=d("el-form");return f(),_("div",M,[s(C,{ref:"registerRef",model:o(r),rules:V,class:"register-form"},{default:t(()=>[e[6]||(e[6]=n("h3",{class:"title"},"办公助手后台管理系统",-1)),s(u,{prop:"username"},{default:t(()=>[s(m,{modelValue:o(r).username,"onUpdate:modelValue":e[0]||(e[0]=l=>o(r).username=l),type:"text",size:"large","auto-complete":"off",placeholder:"账号"},{prefix:t(()=>[s(a,{"icon-class":"user",class:"el-input__icon input-icon"})]),_:1},8,["modelValue"])]),_:1}),s(u,{prop:"password"},{default:t(()=>[s(m,{modelValue:o(r).password,"onUpdate:modelValue":e[1]||(e[1]=l=>o(r).password=l),type:"password",size:"large","auto-complete":"off",placeholder:"密码",onKeyup:w(c,["enter"])},{prefix:t(()=>[s(a,{"icon-class":"password",class:"el-input__icon input-icon"})]),_:1},8,["modelValue"])]),_:1}),s(u,{prop:"confirmPassword"},{default:t(()=>[s(m,{modelValue:o(r).confirmPassword,"onUpdate:modelValue":e[2]||(e[2]=l=>o(r).confirmPassword=l),type:"password",size:"large","auto-complete":"off",placeholder:"确认密码",onKeyup:w(c,["enter"])},{prefix:t(()=>[s(a,{"icon-class":"password",class:"el-input__icon input-icon"})]),_:1},8,["modelValue"])]),_:1}),o(b)?(f(),U(u,{key:0,prop:"code"},{default:t(()=>[s(m,{size:"large",modelValue:o(r).code,"onUpdate:modelValue":e[3]||(e[3]=l=>o(r).code=l),"auto-complete":"off",placeholder:"验证码",style:{width:"63%"},onKeyup:w(c,["enter"])},{prefix:t(()=>[s(a,{"icon-class":"validCode",class:"el-input__icon input-icon"})]),_:1},8,["modelValue"]),n("div",$,[n("img",{src:o(h),onClick:e[4]||(e[4]=(...l)=>i.getCode&&i.getCode(...l)),class:"register-code-img"},null,8,I)])]),_:1})):z("",!0),s(u,{style:{width:"100%"}},{default:t(()=>[s(x,{loading:o(p),size:"large",type:"primary",style:{width:"100%"},onClick:E(c,["prevent"])},{default:t(()=>[o(p)?(f(),_("span",A,"注 册 中...")):(f(),_("span",j,"注 册"))]),_:1},8,["loading"]),n("div",F,[s(k,{class:"link-type",to:"/login"},{default:t(()=>e[5]||(e[5]=[K("使用已有账户登录")])),_:1})])]),_:1})]),_:1},8,["model"]),e[7]||(e[7]=n("div",{class:"el-register-footer"},[n("span",null,"Copyright © 2018-2025 ruoyi.vip All Rights Reserved.")],-1))])}}},D=R(H,[["__scopeId","data-v-249b16ec"]]);export{D as default};
