onChooseAvatar(e){ console.log(e); this.$uploadImage('/api/uploadImage', e.detail.avatarUrl).then(res => { console.log('2',res); if (res.code == 200) { this.new_avatar_url = res.data.path this.$http.post('/api/editUserInfo',{ name:this.userinfo.name, head_portrait:this.new_avatar_url ? this.new_avatar_url : this.userinfo.head_portrait }).then(res=>{ if(res.code == 200){ this.$toast('修改成功') } }) } }) },