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