import{Z as U,x as f,r as i,o as v,a as h,b as e,d as t,e as o,K as z,_ as B,$ as I,a0 as w,A as O,t as u,B as S,P as N,C as T,i as E,g as M}from"./vendor.475775fc.js";import{_ as $,g as j,r as A}from"./index.e07f9e9c.js";const V=c=>(B("data-v-7a772904"),c=c(),I(),c),F=V(()=>u("h3",{class:"title"},"\u6613\u7AD9\u8BBE\u5907\u7BA1\u7406\u7CFB\u7EDF",-1)),H={class:"register-code"},L=["src"],Z={key:0},D={key:1},G={style:{float:"right"}},J=V(()=>u("div",{class:"el-register-footer"},[u("span",null,"Copyright \xA9 2018-2022 ruoyi.vip All Rights Reserved.")],-1)),Q={__name:"register",setup(c){const k="",b=U(),{proxy:C}=M(),s=f({username:"",password:"",confirmPassword:"",code:"",uuid:""}),K={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:(l,r,a)=>{s.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"}]},x=f(""),p=f(!1),m=f(!0);function _(){C.$refs.registerRef.validate(l=>{l&&(p.value=!0,A(s.value).then(r=>{const a=s.value.username;E.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(()=>{b.push("/login")}).catch(()=>{})}).catch(()=>{p.value=!1,m&&y()}))})}function y(){j().then(l=>{m.value=l.captchaOnOff===void 0?!0:l.captchaOnOff,m.value&&(x.value="data:image/gif;base64,"+l.img,s.value.uuid=l.uuid)})}return y(),(l,r)=>{const a=i("svg-icon"),g=i("el-input"),d=i("el-form-item"),P=i("el-button"),q=i("router-link"),R=i("el-form");return v(),h("div",{class:"register",style:z("background-image: url("+o(k)+"/alarm_folder/html_images/background.png);")},[e(R,{ref:"registerRef",model:o(s),rules:K,class:"register-form"},{default:t(()=>[F,e(d,{prop:"username"},{default:t(()=>[e(g,{modelValue:o(s).username,"onUpdate:modelValue":r[0]||(r[0]=n=>o(s).username=n),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(g,{modelValue:o(s).password,"onUpdate:modelValue":r[1]||(r[1]=n=>o(s).password=n),type:"password",size:"large","auto-complete":"off",placeholder:"\u5BC6\u7801",onKeyup:w(_,["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(g,{modelValue:o(s).confirmPassword,"onUpdate:modelValue":r[2]||(r[2]=n=>o(s).confirmPassword=n),type:"password",size:"large","auto-complete":"off",placeholder:"\u786E\u8BA4\u5BC6\u7801",onKeyup:w(_,["enter"])},{prefix:t(()=>[e(a,{"icon-class":"password",class:"el-input__icon input-icon"})]),_:1},8,["modelValue","onKeyup"])]),_:1}),o(m)?(v(),O(d,{key:0,prop:"code"},{default:t(()=>[e(g,{size:"large",modelValue:o(s).code,"onUpdate:modelValue":r[3]||(r[3]=n=>o(s).code=n),"auto-complete":"off",placeholder:"\u9A8C\u8BC1\u7801",style:{width:"63%"},onKeyup:w(_,["enter"])},{prefix:t(()=>[e(a,{"icon-class":"validCode",class:"el-input__icon input-icon"})]),_:1},8,["modelValue","onKeyup"]),u("div",H,[u("img",{src:o(x),onClick:y,class:"register-code-img"},null,8,L)])]),_:1})):S("",!0),e(d,{style:{width:"100%"}},{default:t(()=>[e(P,{loading:o(p),size:"large",type:"primary",style:{width:"100%"},onClick:N(_,["prevent"])},{default:t(()=>[o(p)?(v(),h("span",D,"\u6CE8 \u518C \u4E2D...")):(v(),h("span",Z,"\u6CE8 \u518C"))]),_:1},8,["loading","onClick"]),u("div",G,[e(q,{class:"link-type",to:"/login"},{default:t(()=>[T("\u4F7F\u7528\u5DF2\u6709\u8D26\u6237\u767B\u5F55")]),_:1})])]),_:1})]),_:1},8,["model"]),J],4)}}};var ee=$(Q,[["__scopeId","data-v-7a772904"]]);export{ee as default};
