mirror of https://github.com/rocboss/paopao-ce
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
14 KiB
2 lines
14 KiB
var ye=Object.defineProperty,ke=Object.defineProperties;var be=Object.getOwnPropertyDescriptors;var te=Object.getOwnPropertySymbols;var Ee=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable;var ae=(_,v,g)=>v in _?ye(_,v,{enumerable:!0,configurable:!0,writable:!0,value:g}):_[v]=g,V=(_,v)=>{for(var g in v||(v={}))Ee.call(v,g)&&ae(_,g,v[g]);if(te)for(var g of te(v))Ae.call(v,g)&&ae(_,g,v[g]);return _},j=(_,v)=>ke(_,be(v));import{_ as Ie}from"./main-nav.9110259b.js";import{d as oe,V as r,W as h,Y as d,ah as $e,r as c,Z as Pe,ca as se,a1 as Ue,ae as xe,a3 as u,a4 as s,a5 as k,a6 as f,cw as ne,az as Re,a2 as t,a9 as U,aY as Se,aZ as qe,a8 as p,bj as x,a7 as R,bM as ze,bN as Ne,cx as Ke,cy as Me,cz as Ve,cA as je,cB as Te,cC as Le,ad as Oe,J as We,_ as Ge,cD as Je,cE as Ye,cF as Ze,cG as He}from"./index.f480f018.js";import{c as Qe}from"./Upload.efe3adfd.js";import{_ as Xe}from"./Alert.a854329b.js";import{_ as eu}from"./InputGroup.f69c4956.js";const uu={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},tu=d("g",{fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[d("path",{d:"M9 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-3"}),d("path",{d:"M9 15h3l8.5-8.5a1.5 1.5 0 0 0-3-3L9 12v3"}),d("path",{d:"M16 5l3 3"})],-1),au=[tu];var su=oe({name:"Edit",render:function(v,g){return r(),h("svg",uu,au)}});const T=_=>(ze("data-v-6eb93a4d"),_=_(),Ne(),_),nu={class:"base-line avatar"},ou=p("\u66F4\u6539\u5934\u50CF"),lu={class:"base-line"},ru=T(()=>d("span",{class:"base-label"},"\u6635\u79F0",-1)),iu={key:0},du={class:"base-line"},cu=T(()=>d("span",{class:"base-label"},"\u7528\u6237\u540D",-1)),pu={key:0},_u=p(" \u6362\u7ED1\u624B\u673A "),vu={key:1},mu=p(" \u6210\u529F\u7ED1\u5B9A\u624B\u673A\u540E\uFF0C\u624D\u80FD\u8FDB\u884C\u6362\u5934\u50CF\u3001\u53D1\u52A8\u6001\u3001\u56DE\u590D\u7B49\u4EA4\u4E92~"),fu=T(()=>d("br",null,null,-1)),hu={key:2,class:"phone-bind-wrap"},gu={class:"captcha-img-wrap"},Fu={class:"captcha-img"},Cu=["src"],wu={class:"form-submit-wrap"},Bu=p(" \u53D6\u6D88 "),Du=p(" \u7ED1\u5B9A "),yu={key:0},ku=p(" \u91CD\u65B0\u6FC0\u6D3B "),bu={key:1},Eu=p(" \u6210\u529F\u6FC0\u6D3B\u540E\u540E\uFF0C\u624D\u80FD\u53D1\uFF08\u516C\u5F00/\u597D\u53CB\u53EF\u89C1\uFF09\u52A8\u6001\u3001\u56DE\u590D~"),Au=T(()=>d("br",null,null,-1)),Iu={key:2,class:"phone-bind-wrap"},$u={class:"captcha-img-wrap"},Pu={class:"captcha-img"},Uu=["src"],xu={class:"form-submit-wrap"},Ru=p(" \u53D6\u6D88 "),Su=p(" \u6FC0\u6D3B "),qu=p(" \u60A8\u5DF2\u8BBE\u7F6E\u5BC6\u7801 "),zu=p(" \u91CD\u7F6E\u5BC6\u7801 "),Nu={key:1,class:"phone-bind-wrap"},Ku={class:"form-submit-wrap"},Mu=p(" \u53D6\u6D88 "),Vu=p(" \u66F4\u65B0 "),ju=oe({setup(_){const v="/v1/attachment",g="Bearer "+localStorage.getItem("PAOPAO_TOKEN"),S=c("public/avatar"),A="true".toLowerCase()==="true",le="false".toLowerCase()==="true",o=Pe(),I=c(!1),q=c(!1),z=c(!1),Y=c(),Z=c(),b=c(!1),N=c(!1),$=c(!1),P=c(!1),E=c(60),D=c(!1),y=c(!1),H=c(),Q=c(),X=c(),ee=c(),a=se({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),i=se({id:"",b64s:"",imgCaptcha:"",activate_code:""}),re=async n=>{var e,F;return S.value==="public/avatar"&&!["image/png","image/jpg","image/jpeg"].includes((e=n.file.file)==null?void 0:e.type)?(window.$message.warning("\u5934\u50CF\u4EC5\u5141\u8BB8 png/jpg \u683C\u5F0F"),!1):S.value==="image"&&((F=n.file.file)==null?void 0:F.size)>1048576?(window.$message.warning("\u5934\u50CF\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC71MB"),!1):!0},ie=({file:n,event:e})=>{var F;try{let C=JSON.parse((F=e.target)==null?void 0:F.response);C.code===0&&S.value==="public/avatar"&&Ke({avatar:C.data.content}).then(m=>{var K;window.$message.success("\u5934\u50CF\u66F4\u65B0\u6210\u529F"),(K=Y.value)==null||K.clear(),o.commit("updateUserinfo",j(V({},o.state.userInfo),{avatar:C.data.content}))}).catch(m=>{console.log(m)})}catch{window.$message.error("\u4E0A\u4F20\u5931\u8D25")}},de=(n,e)=>!!a.password&&a.password.startsWith(e)&&a.password.length>=e.length,ce=(n,e)=>e===a.password,pe=()=>{var n;a.reenteredPassword&&((n=ee.value)==null||n.validate({trigger:"password-input"}))},_e=n=>{var e;n.preventDefault(),(e=X.value)==null||e.validate(F=>{F||(N.value=!0,Me({password:a.password,old_password:a.old_password}).then(C=>{N.value=!1,$.value=!1,window.$message.success("\u5BC6\u7801\u91CD\u7F6E\u6210\u529F"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(C=>{N.value=!1}))})},ve=n=>{var e;n.preventDefault(),(e=H.value)==null||e.validate(F=>{F||(q.value=!0,Ve({phone:a.phone,captcha:a.phone_captcha}).then(C=>{q.value=!1,D.value=!1,window.$message.success("\u7ED1\u5B9A\u6210\u529F"),o.commit("updateUserinfo",j(V({},o.state.userInfo),{phone:a.phone})),a.id="",a.b64s="",a.imgCaptcha="",a.phone="",a.phone_captcha=""}).catch(C=>{q.value=!1}))})},me=n=>{var e;n.preventDefault(),(e=Q.value)==null||e.validate(F=>{if(i.imgCaptcha===""){window.$message.warning("\u8BF7\u8F93\u5165\u56FE\u7247\u9A8C\u8BC1\u7801");return}I.value=!0,F||(z.value=!0,je({activate_code:i.activate_code,captcha_id:i.id,imgCaptcha:i.imgCaptcha}).then(C=>{z.value=!1,y.value=!1,window.$message.success("\u6FC0\u6D3B\u6210\u529F"),o.commit("updateUserinfo",j(V({},o.state.userInfo),{activation:i.activate_code})),i.id="",i.b64s="",i.imgCaptcha="",i.activate_code=""}).catch(C=>{z.value=!1,C.code===20012&&O()}))})},L=()=>{ne().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},O=()=>{ne().then(n=>{i.id=n.id,i.b64s=n.b64s}).catch(n=>{console.log(n)})},fe=()=>{Te({nickname:o.state.userInfo.nickname||""}).then(n=>{b.value=!1,window.$message.success("\u6635\u79F0\u4FEE\u6539\u6210\u529F")}).catch(n=>{b.value=!0})},he=()=>{if(!(E.value>0&&P.value)){if(a.imgCaptcha===""){window.$message.warning("\u8BF7\u8F93\u5165\u56FE\u7247\u9A8C\u8BC1\u7801");return}I.value=!0,Le({phone:a.phone,img_captcha:a.imgCaptcha,img_captcha_id:a.id}).then(n=>{P.value=!0,I.value=!1,window.$message.success("\u53D1\u9001\u6210\u529F");let e=setInterval(()=>{E.value--,E.value===0&&(clearInterval(e),E.value=60,P.value=!1)},1e3)}).catch(n=>{I.value=!1,n.code===20012&&L(),console.log(n)})}},ge={phone:[{required:!0,message:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7",trigger:["input"],validator:(n,e)=>/^[1]+[3-9]{1}\d{9}$/.test(e)}],phone_captcha:[{required:!0,message:"\u8BF7\u8F93\u5165\u624B\u673A\u9A8C\u8BC1\u7801"}]},Fe={activate_code:[{required:!0,message:"\u8BF7\u8F93\u5165\u6FC0\u6D3B\u7801",trigger:["input"],validator:(n,e)=>/\d{6}$/.test(e)}]},Ce={password:[{required:!0,message:"\u8BF7\u8F93\u5165\u65B0\u5BC6\u7801"}],old_password:[{required:!0,message:"\u8BF7\u8F93\u5165\u65E7\u5BC6\u7801"}],reenteredPassword:[{required:!0,message:"\u8BF7\u518D\u6B21\u8F93\u5165\u5BC6\u7801",trigger:["input","blur"]},{validator:de,message:"\u4E24\u6B21\u5BC6\u7801\u8F93\u5165\u4E0D\u4E00\u81F4",trigger:"input"},{validator:ce,message:"\u4E24\u6B21\u5BC6\u7801\u8F93\u5165\u4E0D\u4E00\u81F4",trigger:["blur","password-input"]}]},we=()=>{b.value=!0,setTimeout(()=>{var n;(n=Z.value)==null||n.focus()},30)};return Ue(()=>{o.state.userInfo.id===0&&(o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")),L(),O()}),(n,e)=>{const F=Ie,C=Oe,m=We,K=Qe,w=Ge,Be=xe,M=Re,ue=Xe,B=Je,De=eu,W=Ye,G=Ze,J=He;return r(),h("div",null,[u(F,{title:"\u8BBE\u7F6E",theme:""}),u(M,{title:"\u57FA\u672C\u4FE1\u606F",size:"small",class:"setting-card"},{default:s(()=>[d("div",nu,[u(C,{class:"avatar-img",size:80,src:t(o).state.userInfo.avatar},null,8,["src"]),!A||A&&t(o).state.userInfo.phone&&t(o).state.userInfo.phone.length>0?(r(),k(K,{key:0,ref_key:"avatarRef",ref:Y,action:v,headers:{Authorization:g},data:{type:S.value},onBeforeUpload:re,onFinish:ie},{default:s(()=>[u(m,{size:"small"},{default:s(()=>[ou]),_:1})]),_:1},8,["headers","data"])):f("",!0)]),d("div",lu,[ru,b.value?f("",!0):(r(),h("div",iu,U(t(o).state.userInfo.nickname),1)),Se(u(w,{ref_key:"inputInstRef",ref:Z,class:"nickname-input",value:t(o).state.userInfo.nickname,"onUpdate:value":e[0]||(e[0]=l=>t(o).state.userInfo.nickname=l),type:"text",size:"small",placeholder:"\u8BF7\u8F93\u5165\u6635\u79F0",onBlur:fe,maxlength:16},null,8,["value"]),[[qe,b.value]]),!b.value&&(!A||A&&t(o).state.userInfo.phone&&t(o).state.userInfo.phone.length>0&&t(o).state.userInfo.status==1)?(r(),k(m,{key:1,quaternary:"",round:"",type:"success",size:"small",onClick:we},{icon:s(()=>[u(Be,null,{default:s(()=>[u(t(su))]),_:1})]),_:1})):f("",!0)]),d("div",du,[cu,p(" @"+U(t(o).state.userInfo.username),1)])]),_:1}),A?(r(),k(M,{key:0,title:"\u624B\u673A\u53F7",size:"small",class:"setting-card"},{default:s(()=>[t(o).state.userInfo.phone&&t(o).state.userInfo.phone.length>0?(r(),h("div",pu,[p(U(t(o).state.userInfo.phone)+" ",1),!D.value&&t(o).state.userInfo.status==1?(r(),k(m,{key:0,quaternary:"",round:"",type:"success",onClick:e[1]||(e[1]=l=>D.value=!0)},{default:s(()=>[_u]),_:1})):f("",!0)])):(r(),h("div",vu,[u(ue,{title:"\u624B\u673A\u7ED1\u5B9A\u63D0\u793A",type:"warning"},{default:s(()=>[mu,fu,D.value?f("",!0):(r(),h("a",{key:0,class:"hash-link",onClick:e[2]||(e[2]=l=>D.value=!0)}," \u7ACB\u5373\u7ED1\u5B9A "))]),_:1})])),D.value?(r(),h("div",hu,[u(J,{ref_key:"phoneFormRef",ref:H,model:t(a),rules:ge},{default:s(()=>[u(B,{path:"phone",label:"\u624B\u673A\u53F7"},{default:s(()=>[u(w,{value:t(a).phone,"onUpdate:value":e[3]||(e[3]=l=>t(a).phone=l.trim()),placeholder:"\u8BF7\u8F93\u5165\u4E2D\u56FD\u5927\u9646\u624B\u673A\u53F7",onKeydown:e[4]||(e[4]=x(R(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),u(B,{path:"img_captcha",label:"\u56FE\u5F62\u9A8C\u8BC1\u7801"},{default:s(()=>[d("div",gu,[u(w,{value:t(a).imgCaptcha,"onUpdate:value":e[5]||(e[5]=l=>t(a).imgCaptcha=l),placeholder:"\u8BF7\u8F93\u5165\u56FE\u5F62\u9A8C\u8BC1\u7801\u540E\u83B7\u53D6\u9A8C\u8BC1\u7801"},null,8,["value"]),d("div",Fu,[t(a).b64s?(r(),h("img",{key:0,src:t(a).b64s,onClick:L},null,8,Cu)):f("",!0)])])]),_:1}),u(B,{path:"phone_captcha",label:"\u77ED\u4FE1\u9A8C\u8BC1\u7801"},{default:s(()=>[u(De,null,{default:s(()=>[u(w,{value:t(a).phone_captcha,"onUpdate:value":e[6]||(e[6]=l=>t(a).phone_captcha=l),placeholder:"\u8BF7\u8F93\u5165\u6536\u5230\u7684\u77ED\u4FE1\u9A8C\u8BC1\u7801"},null,8,["value"]),u(m,{type:"primary",ghost:"",disabled:P.value,loading:I.value,onClick:he},{default:s(()=>[p(U(E.value>0&&P.value?E.value+"s\u540E\u91CD\u65B0\u53D1\u9001":"\u53D1\u9001\u9A8C\u8BC1\u7801"),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1}),u(G,{gutter:[0,24]},{default:s(()=>[u(W,{span:24},{default:s(()=>[d("div",wu,[u(m,{quaternary:"",round:"",onClick:e[7]||(e[7]=l=>D.value=!1)},{default:s(()=>[Bu]),_:1}),u(m,{secondary:"",round:"",type:"primary",loading:q.value,onClick:ve},{default:s(()=>[Du]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):f("",!0)]),_:1})):f("",!0),le?(r(),k(M,{key:1,title:"\u6FC0\u6D3B\u7801",size:"small",class:"setting-card"},{default:s(()=>[t(o).state.userInfo.activation&&t(o).state.userInfo.activation.length>0?(r(),h("div",yu,[p(U(t(o).state.userInfo.activation)+" ",1),y.value?f("",!0):(r(),k(m,{key:0,quaternary:"",round:"",type:"success",onClick:e[8]||(e[8]=l=>y.value=!0)},{default:s(()=>[ku]),_:1}))])):(r(),h("div",bu,[u(ue,{title:"\u6FC0\u6D3B\u7801\u6FC0\u6D3B\u63D0\u793A",type:"warning"},{default:s(()=>[Eu,Au,y.value?f("",!0):(r(),h("a",{key:0,class:"hash-link",onClick:e[9]||(e[9]=l=>y.value=!0)}," \u7ACB\u5373\u6FC0\u6D3B "))]),_:1})])),y.value?(r(),h("div",Iu,[u(J,{ref_key:"activateFormRef",ref:Q,model:t(i),rules:Fe},{default:s(()=>[u(B,{path:"activate_code",label:"\u6FC0\u6D3B\u7801"},{default:s(()=>[u(w,{value:t(i).activate_code,"onUpdate:value":e[10]||(e[10]=l=>t(i).activate_code=l.trim()),placeholder:"\u8BF7\u8F93\u5165\u6FC0\u6D3B\u7801",onKeydown:e[11]||(e[11]=x(R(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),u(B,{path:"img_captcha",label:"\u56FE\u5F62\u9A8C\u8BC1\u7801"},{default:s(()=>[d("div",$u,[u(w,{value:t(i).imgCaptcha,"onUpdate:value":e[12]||(e[12]=l=>t(i).imgCaptcha=l),placeholder:"\u8BF7\u8F93\u5165\u56FE\u5F62\u9A8C\u8BC1\u7801\u540E\u83B7\u53D6\u9A8C\u8BC1\u7801"},null,8,["value"]),d("div",Pu,[t(i).b64s?(r(),h("img",{key:0,src:t(i).b64s,onClick:O},null,8,Uu)):f("",!0)])])]),_:1}),u(G,{gutter:[0,24]},{default:s(()=>[u(W,{span:24},{default:s(()=>[d("div",xu,[u(m,{quaternary:"",round:"",onClick:e[13]||(e[13]=l=>y.value=!1)},{default:s(()=>[Ru]),_:1}),u(m,{secondary:"",round:"",type:"primary",loading:z.value,onClick:me},{default:s(()=>[Su]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):f("",!0)]),_:1})):f("",!0),u(M,{title:"\u8D26\u6237\u5B89\u5168",size:"small",class:"setting-card"},{default:s(()=>[qu,$.value?f("",!0):(r(),k(m,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>$.value=!0)},{default:s(()=>[zu]),_:1})),$.value?(r(),h("div",Nu,[u(J,{ref_key:"formRef",ref:X,model:t(a),rules:Ce},{default:s(()=>[u(B,{path:"old_password",label:"\u65E7\u5BC6\u7801"},{default:s(()=>[u(w,{value:t(a).old_password,"onUpdate:value":e[15]||(e[15]=l=>t(a).old_password=l),type:"password",placeholder:"\u8BF7\u8F93\u5165\u5F53\u524D\u5BC6\u7801",onKeydown:e[16]||(e[16]=x(R(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),u(B,{path:"password",label:"\u65B0\u5BC6\u7801"},{default:s(()=>[u(w,{value:t(a).password,"onUpdate:value":e[17]||(e[17]=l=>t(a).password=l),type:"password",placeholder:"\u8BF7\u8F93\u5165\u65B0\u5BC6\u7801",onInput:pe,onKeydown:e[18]||(e[18]=x(R(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),u(B,{ref_key:"rPasswordFormItemRef",ref:ee,first:"",path:"reenteredPassword",label:"\u91CD\u590D\u5BC6\u7801"},{default:s(()=>[u(w,{value:t(a).reenteredPassword,"onUpdate:value":e[19]||(e[19]=l=>t(a).reenteredPassword=l),disabled:!t(a).password,type:"password",placeholder:"\u8BF7\u518D\u6B21\u8F93\u5165\u5BC6\u7801",onKeydown:e[20]||(e[20]=x(R(()=>{},["prevent"]),["enter"]))},null,8,["value","disabled"])]),_:1},512),u(G,{gutter:[0,24]},{default:s(()=>[u(W,{span:24},{default:s(()=>[d("div",Ku,[u(m,{quaternary:"",round:"",onClick:e[21]||(e[21]=l=>$.value=!1)},{default:s(()=>[Mu]),_:1}),u(m,{secondary:"",round:"",type:"primary",loading:N.value,onClick:_e},{default:s(()=>[Vu]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):f("",!0)]),_:1})])}}});var Yu=$e(ju,[["__scopeId","data-v-6eb93a4d"]]);export{Yu as default};
|