import{bo as $,j as g,i as h,o as C,c as S,a as e,w as t,d as r,l as s,b as k,e as y,bp as J,$ as p,bq as O,br as x,N as U,f as B,y as P,D as V}from"./index.0f087b09.js";import{_ as D}from"./Input.e1f7150d.js";const I=r("div",{class:"form_tag_wrapper"},"\u6635\u79F0",-1),T=r("div",{class:"form_tag_wrapper"},"\u65E7\u5BC6\u7801",-1),j=r("div",{class:"form_tag_wrapper"},"\u65B0\u5BC6\u7801",-1),q=r("div",{class:"form_tag_wrapper"},"\u786E\u8BA4\u5BC6\u7801",-1),E={__name:"info",setup(M){const c=$(),i=g({account_id:0,nickname:""}),f=async()=>{const l=await J();p(l,()=>{c.admin_info=l.data.info,i.value=JSON.parse(JSON.stringify(l.data.info))})};h(()=>{f()});const N=async()=>{if(i.value.nickname===c.admin_info.nickname)return;const l=await O(i.value.nickname);p(l,()=>{f(),window.$message().success("\u4FEE\u6539\u6210\u529F")})},m={old:"",new:"",check:""},b=async()=>{if(w())return;const l=await x({account_id:i.value.account_id,password:n.value.new,old_password:n.value.old});p(l,()=>{n.value=JSON.parse(JSON.stringify(m)),window.$message().success("\u4FEE\u6539\u6210\u529F")})},n=g(JSON.parse(JSON.stringify(m))),w=()=>n.value.old.length<6||n.value.old.length>20||n.value.new.length<6||n.value.new.length>20||n.value.new!==n.value.check;return(l,a)=>{const u=U,d=D,v=B,_=P,A=V;return C(),S("div",null,[e(A,{title:"\u4E2A\u4EBA\u8BBE\u7F6E"},{default:t(()=>[r("div",null,[e(_,{align:"center"},{default:t(()=>[e(u,null,{default:t(()=>[I]),_:1}),e(d,{class:"form_input_wrapper",value:s(i).nickname,"onUpdate:value":a[0]||(a[0]=o=>s(i).nickname=o)},null,8,["value"]),e(v,{disabled:s(i).nickname===s(c).admin_info.nickname,onClick:a[1]||(a[1]=o=>N()),type:"info"},{default:t(()=>[k("\u4FEE\u6539\u6635\u79F0 ")]),_:1},8,["disabled"])]),_:1}),e(_,{"mt-5":"",align:"center"},{default:t(()=>[e(u,null,{default:t(()=>[T]),_:1}),e(d,{type:"password",class:"form_input_wrapper",value:s(n).old,"onUpdate:value":a[2]||(a[2]=o=>s(n).old=o)},null,8,["value"])]),_:1}),e(_,{"mt-2":"",align:"center"},{default:t(()=>[e(u,null,{default:t(()=>[j]),_:1}),e(d,{type:"password",class:"form_input_wrapper",value:s(n).new,"onUpdate:value":a[3]||(a[3]=o=>s(n).new=o)},null,8,["value"])]),_:1}),e(_,{"mt-2":"",align:"center"},{default:t(()=>[e(u,null,{default:t(()=>[q]),_:1}),e(d,{type:"password",class:"form_input_wrapper",value:s(n).check,"onUpdate:value":a[4]||(a[4]=o=>s(n).check=o)},null,8,["value"])]),_:1}),e(v,{disabled:w(),onClick:a[5]||(a[5]=o=>b()),"mt-5":"",type:"info"},{default:t(()=>[k("\u4FEE\u6539\u5BC6\u7801 ")]),_:1},8,["disabled"])])]),_:1})])}}};typeof y=="function"&&y(E);export{E as default};
