import{u as e}from"./useCreate-b3492f2b.js";import{d as a,k as l,p as s,u as r,r as u,K as t,J as o,f as d,o as m,j as n,w as p,a as i,e as f,b as v,t as c,R as _,_ as g}from"./index-018fb6dd.js";const V={class:"flex justify-center"},b=g(a({__name:"profile",setup(a){const g=l(Object.assign({avatar:"",username:"",email:"",password:""})),{form:b,loading:w,submitForm:y,afterCreate:h}=e("user/online",null,g);s((()=>{w.value=!0,_.get("user/online").then((e=>{g.value.username=e.data.data.username,g.value.avatar=e.data.data.avatar,g.value.email=e.data.data.email,w.value=!1}))}));const j=r();return h.value=()=>{j.getUserInfo()},(e,a)=>{const l=u("el-input"),s=u("el-form-item"),r=u("el-button"),_=u("el-form"),h=t("loading");return o((m(),n(_,{model:g.value,ref_key:"form",ref:b,"label-position":"top"},{default:p((()=>[i(s,{label:"昵称",prop:"username",class:"mt-2",rules:[{required:!0,message:"昵称必须填写"}]},{default:p((()=>[i(l,{modelValue:g.value.username,"onUpdate:modelValue":a[0]||(a[0]=e=>g.value.username=e),placeholder:"请填写昵称"},null,8,["modelValue"])])),_:1}),i(s,{label:"邮箱",prop:"email",rules:[{required:!0,message:"邮箱必须填写"},{type:"email",message:"邮箱格式不正确"}]},{default:p((()=>[i(l,{modelValue:g.value.email,"onUpdate:modelValue":a[1]||(a[1]=e=>g.value.email=e),placeholder:"请填写邮箱"},null,8,["modelValue"])])),_:1}),i(s,{label:"密码",prop:"password",rules:[{pattern:/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,20}$/,message:"必须包含大小写字母和数字的组合，可以使用特殊字符，长度在6-20之间"}]},{default:p((()=>[i(l,{modelValue:g.value.password,"onUpdate:modelValue":a[2]||(a[2]=e=>g.value.password=e),type:"password","show-password":"",placeholder:"请输入密码"},null,8,["modelValue"])])),_:1},8,["rules"]),f("div",V,[i(r,{type:"primary",onClick:a[3]||(a[3]=e=>d(y)(d(b)))},{default:p((()=>[v(c(e.$t("system.update")),1)])),_:1})])])),_:1},8,["model"])),[[h,d(w)]])}}}),[["__scopeId","data-v-53e23e40"]]);export{b as default};
