profile-e1138e81.js 2.1 KB

1
  1. /* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{u as e}from"./useCreate-05f1dd3d.js";import{d as a,m as l,y as s,u as t,X as r,f as o,o as u,l as m,w as d,a as p,e as n,b as i,t as f,aa as v,a3 as c,a4 as _,U as b,Z as g,a0 as j,_ as V}from"./index-ca84c486.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:U,afterCreate:x}=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=t();return x.value=()=>{C.getUserInfo()},(e,a)=>{const l=c,s=_,t=b,v=g,x=j;return r((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(t,{type:"primary",onClick:a[3]||(a[3]=e=>o(U)(o(y)))},{default:d((()=>[i(f(e.$t("system.update")),1)])),_:1})])])),_:1},8,["model"])),[[x,o(h)]])}}}),[["__scopeId","data-v-53e23e40"]]);export{y as default};