import{_ as K,r as g,d as i,o as f,c as y,e,w as t,f as s,a as P,g as I,i as v,k as U,l as w,j as z,n as B,m as R,t as N,E as S,p as T,q as M,s as $}from"./index.bba5ce79.js";const j=u=>(T("data-v-633d4fe5"),u=u(),M(),u),F={class:"register"},H=j(()=>w("h3",{class:"title"},"\u9752\u5C9B\u673A\u573A\u65E0\u4EBA\u9A7E\u9A76\u8F66\u8F86\u534F\u540C\u4E91\u5E73\u53F0",-1)),L={class:"register-code"},A=["src"],D={key:0},G={key:1},J={style:{float:"right"}},O={__name:"register",setup(u){const x=P(),{proxy:k}=$(),o=g({username:"",password:"",confirmPassword:"",code:"",uuid:""}),b={username:[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165\u60A8\u7684\u8D26\u53F7"},{min:2,max:20,message:"\u7528\u6237\u8D26\u53F7\u957F\u5EA6\u5FC5\u987B\u4ECB\u4E8E 2 \u548C 20 \u4E4B\u95F4",trigger:"blur"}],password:[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165\u60A8\u7684\u5BC6\u7801"},{min:5,max:20,message:"\u7528\u6237\u5BC6\u7801\u957F\u5EA6\u5FC5\u987B\u4ECB\u4E8E 5 \u548C 20 \u4E4B\u95F4",trigger:"blur"}],confirmPassword:[{required:!0,trigger:"blur",message:"\u8BF7\u518D\u6B21\u8F93\u5165\u60A8\u7684\u5BC6\u7801"},{required:!0,validator:(n,r,a)=>{o.value.password!==r?a(new Error("\u4E24\u6B21\u8F93\u5165\u7684\u5BC6\u7801\u4E0D\u4E00\u81F4")):a()},trigger:"blur"}],code:[{required:!0,trigger:"change",message:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801"}]},V=g(""),c=g(!1),p=g(!0);function m(){k.$refs.registerRef.validate(n=>{n&&(c.value=!0,N(o.value).then(r=>{const a=o.value.username;S.alert("<font color='red'>\u606D\u559C\u4F60\uFF0C\u60A8\u7684\u8D26\u53F7 "+a+" \u6CE8\u518C\u6210\u529F\uFF01</font>","\u7CFB\u7EDF\u63D0\u793A",{dangerouslyUseHTMLString:!0,type:"success"}).then(()=>{x.push("/login")}).catch(()=>{})}).catch(()=>{c.value=!1,p&&h()}))})}function h(){I().then(n=>{p.value=n.captchaEnabled===void 0?!0:n.captchaEnabled,p.value&&(V.value="data:image/gif;base64,"+n.img,o.value.uuid=n.uuid)})}return h(),(n,r)=>{const a=i("svg-icon"),_=i("el-input"),d=i("el-form-item"),C=i("el-button"),q=i("router-link"),E=i("el-form");return f(),y("div",F,[e(E,{ref:"registerRef",model:s(o),rules:b,class:"register-form"},{default:t(()=>[H,e(d,{prop:"username"},{default:t(()=>[e(_,{modelValue:s(o).username,"onUpdate:modelValue":r[0]||(r[0]=l=>s(o).username=l),type:"text",size:"large","auto-complete":"off",placeholder:"\u8D26\u53F7"},{prefix:t(()=>[e(a,{"icon-class":"user",class:"el-input__icon input-icon"})]),_:1},8,["modelValue"])]),_:1}),e(d,{prop:"password"},{default:t(()=>[e(_,{modelValue:s(o).password,"onUpdate:modelValue":r[1]||(r[1]=l=>s(o).password=l),type:"password",size:"large","auto-complete":"off",placeholder:"\u5BC6\u7801",onKeyup:v(m,["enter"])},{prefix:t(()=>[e(a,{"icon-class":"password",class:"el-input__icon input-icon"})]),_:1},8,["modelValue","onKeyup"])]),_:1}),e(d,{prop:"confirmPassword"},{default:t(()=>[e(_,{modelValue:s(o).confirmPassword,"onUpdate:modelValue":r[2]||(r[2]=l=>s(o).confirmPassword=l),type:"password",size:"large","auto-complete":"off",placeholder:"\u786E\u8BA4\u5BC6\u7801",onKeyup:v(m,["enter"])},{prefix:t(()=>[e(a,{"icon-class":"password",class:"el-input__icon input-icon"})]),_:1},8,["modelValue","onKeyup"])]),_:1}),s(p)?(f(),U(d,{key:0,prop:"code"},{default:t(()=>[e(_,{size:"large",modelValue:s(o).code,"onUpdate:modelValue":r[3]||(r[3]=l=>s(o).code=l),"auto-complete":"off",placeholder:"\u9A8C\u8BC1\u7801",style:{width:"63%"},onKeyup:v(m,["enter"])},{prefix:t(()=>[e(a,{"icon-class":"validCode",class:"el-input__icon input-icon"})]),_:1},8,["modelValue","onKeyup"]),w("div",L,[w("img",{src:s(V),onClick:h,class:"register-code-img"},null,8,A)])]),_:1})):z("",!0),e(d,{style:{width:"100%"}},{default:t(()=>[e(C,{loading:s(c),size:"large",type:"primary",style:{width:"100%"},onClick:B(m,["prevent"])},{default:t(()=>[s(c)?(f(),y("span",G,"\u6CE8 \u518C \u4E2D...")):(f(),y("span",D,"\u6CE8 \u518C"))]),_:1},8,["loading","onClick"]),w("div",J,[e(q,{class:"link-type",to:"/login"},{default:t(()=>[R("\u4F7F\u7528\u5DF2\u6709\u8D26\u6237\u767B\u5F55")]),_:1})])]),_:1})]),_:1},8,["model"])])}}},X=K(O,[["__scopeId","data-v-633d4fe5"]]);export{X as default};
