"use strict";const e=require("../../common/vendor.js"),a=require("../../components/request.js"),i=require("../../components/postFile.js"),n=require("../../components/generateFileName.js"),o=require("../../components/goEasyTool/tool.js"),t={inject:["$global"],data:()=>({userinfo:"",name:"",id:"",info:{},userSig:""}),onLoad(a){e.index.getStorage({key:"userinfo",success:e=>{this.id=e.data.id,this.name=e.data.nickName,this.userinfo=e.data.headerIcon}}),e.index.getStorage({key:"userSig",success:e=>{this.userSig=e.data}})},methods:{cancel(){e.index.navigateBack({delta:1})},inputName(e){this.name=e.detail.value},async Userinfo(e){const{avatarUrl:a}=e.detail;this.userinfo=a},wxLogin(t){o.goEasylogout(this.$goeasy),e.index.showLoading({title:"修改中...",mask:!0}),i.uploadFile({path:this.userinfo,name:n.generateFileName()}).then((i=>{a.request({url:"user/updateUserInfo",method:"POST",data:{id:this.id,headerIcon:i.split("/").pop(),nickName:this.name,usersig:this.userSig.userSig},userInfo:!0}).then((a=>{200===a.code?(e.index.showToast({title:"修改成功",icon:"success"}),e.index.setStorageSync("userinfo",a.data.info),o.goEasylogin(this.$goeasy,String(a.data.info.id),a.data.info.headerIcon,a.data.info.nickName),e.index.hideLoading(),e.index.navigateBack({delta:1})):e.index.showToast({title:"修改失败",icon:"none"})}))})).catch((e=>{console.log(e)}))}}};const s=e._export_sfc(t,[["render",function(a,i,n,o,t,s){return{a:t.userinfo,b:e.o(((...e)=>s.Userinfo&&s.Userinfo(...e))),c:e.o(((...e)=>s.inputName&&s.inputName(...e))),d:t.name,e:e.o((e=>t.name=e.detail.value)),f:e.o(((...e)=>s.wxLogin&&s.wxLogin(...e))),g:e.o(((...e)=>s.cancel&&s.cancel(...e)))}}],["__scopeId","data-v-76be1a10"]]);wx.createPage(s);
