提交修改

This commit is contained in:
quyixiao 2020-08-28 11:42:51 +08:00
parent 8b6bd01a15
commit 3e17a3767a
3 changed files with 28 additions and 11 deletions

View File

@ -56,11 +56,22 @@
},
computed: {
userName: {
get () { return this.$store.state.user.name }
get () {
return this.$store.state.user.username
}
},
realName: {
get () {
return this.$store.state.user.realName
}
},
mainTabs: {
get () { return this.$store.state.common.mainTabs },
set (val) { this.$store.commit('common/updateMainTabs', val) }
get () {
return this.$store.state.common.mainTabs
},
set (val) {
this.$store.commit('common/updateMainTabs', val)
}
}
},
methods: {

View File

@ -38,7 +38,7 @@
<el-menu-item class="site-navbar__avatar" index="3">
<el-dropdown :show-timeout="0" placement="bottom">
<span class="el-dropdown-link">
<img src="~@/assets/img/login/avatar.png" :alt="userName">{{ userName }}
<img src="~@/assets/img/login/avatar.png" :alt="realName">{{ realName }}
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="handleUpdatePassword()">修改密码</el-dropdown-item>
@ -80,7 +80,10 @@
set (val) { this.$store.commit('common/updateMainTabs', val) }
},
userName: {
get () { return this.$store.state.user.name }
get () { return this.$store.state.user.username }
},
realName: {
get () { return this.$store.state.user.realName }
}
},
methods: {

View File

@ -19,7 +19,7 @@
import MainSidebar from './main-sidebar'
import MainContent from './main-content'
import { apiGetUserInfo } from '@/api/api_sys'
export default {
provide () {
return {
@ -55,7 +55,9 @@
set (val) { this.$store.commit('user/updateId', val) }
},
userName: {
get () { return this.$store.state.user.name },
get () {
return this.$store.state.user.userName
},
set (val) { this.$store.commit('user/updateName', val) }
}
},
@ -63,9 +65,9 @@
this.handleGetUserInfo()
},
mounted () {
this.resetDocumentClientHeight()
},
methods: {
//
@ -82,6 +84,7 @@
this.loading = false
this.userId = res.user.userId
this.userName = res.user.username
this.$store.state.user = res.user
this.mobile = res.user.mobile
this.$watermark.set(this.userName + ' ' + this.mobile.substr(0, 4))
} else {
@ -89,8 +92,8 @@
}
})
}
}
}
</script>