mirror of https://github.com/halo-dev/halo
Sync updating avatar
parent
38fb0306b6
commit
926007c45b
|
@ -22,7 +22,7 @@
|
|||
<a-avatar
|
||||
class="avatar"
|
||||
size="small"
|
||||
:src="user.avatar"
|
||||
:src="avatar"
|
||||
/>
|
||||
</span>
|
||||
<a-menu
|
||||
|
@ -79,9 +79,11 @@ export default {
|
|||
this.loadUser()
|
||||
this.loadOptions()
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['nickname', 'avatar'])
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['logout']),
|
||||
...mapGetters(['nickname']),
|
||||
handleLogout() {
|
||||
const that = this
|
||||
|
||||
|
|
|
@ -148,6 +148,7 @@ import AttachmentSelectDrawer from '../attachment/components/AttachmentSelectDra
|
|||
import userApi from '@/api/user'
|
||||
import adminApi from '@/api/admin'
|
||||
import optionApi from '@/api/option'
|
||||
import { mapMutations } from 'vuex'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
@ -180,6 +181,7 @@ export default {
|
|||
this.loadOptions()
|
||||
},
|
||||
methods: {
|
||||
...mapMutations({ setAvatar: 'SET_AVATAR' }),
|
||||
handleShowAttachDrawer() {
|
||||
this.attachmentDrawerVisible = true
|
||||
},
|
||||
|
@ -212,6 +214,7 @@ export default {
|
|||
handleUpdateProfile() {
|
||||
userApi.updateProfile(this.user).then(response => {
|
||||
this.user = response.data.data
|
||||
this.setAvatar(this.user.avatar)
|
||||
this.$message.success('资料更新成功!')
|
||||
})
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue