Commit 0594c0e0 authored by salitedfish's avatar salitedfish

bug修复

parent 37d0565a
...@@ -62,18 +62,22 @@ export default Vue.extend({ ...@@ -62,18 +62,22 @@ export default Vue.extend({
}, },
async fileUpload(event:any){ async fileUpload(event:any){
try{ try{
this.$toast.loading('头像更新中...') this.$toast.loading({
message: '头像更新中...',
duration: 20000,
})
this.file = event.target.files[0] this.file = event.target.files[0]
// this.$store.commit('app/SET_FILEDATA',event.target.files) // this.$store.commit('app/SET_FILEDATA',event.target.files)
const upload = await this.$service.userService.avatarUpload(event.target.files[0]) const upload = await this.$service.userService.avatarUpload(event.target.files[0])
if(upload){ if(upload){
this.avatarImgUrl = (upload as any).avatar this.avatarImgUrl = (upload as any).avatar
this.$util.userMsg.updateUserMsg(upload) this.$util.userMsg.updateUserMsg(upload)
this.$toast.success('头像更新成功') this.$toast.clear()
this.$toast.success('头像更新成功~')
} }
// this.$router.push({name:'PhotoEdit'}) // this.$router.push({name:'PhotoEdit'})
}catch(err){ }catch(err){
this.$toast('头像更新失败') this.$toast('头像更新失败~')
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment