|
|
|
@ -11,8 +11,7 @@ |
|
|
|
|
<el-dropdown class="user-wrap" @command="userCommand"> |
|
|
|
|
<div class="user"> |
|
|
|
|
<el-avatar :size="40" :src="avatar"></el-avatar> |
|
|
|
|
<span class="username" v-if="isCustomer">超**大学</span> |
|
|
|
|
<span class="username" v-else>{{userName}}</span> |
|
|
|
|
<span class="username">{{userName}}</span> |
|
|
|
|
</div> |
|
|
|
|
<el-dropdown-menu slot="dropdown"> |
|
|
|
|
<el-dropdown-item command="person" v-if="!isCustomer">个人资料</el-dropdown-item> |
|
|
|
@ -67,7 +66,6 @@ export default { |
|
|
|
|
rendered: false, |
|
|
|
|
keyword: '', |
|
|
|
|
searchTimer: null, |
|
|
|
|
userName: '', |
|
|
|
|
showSetting: true, |
|
|
|
|
id: '', |
|
|
|
|
schoolName: '', |
|
|
|
@ -82,7 +80,7 @@ export default { |
|
|
|
|
components: { navbar }, |
|
|
|
|
computed: { |
|
|
|
|
...mapState('user', [ |
|
|
|
|
'avatar', 'schoolId', 'isCustomer' |
|
|
|
|
'avatar', 'schoolId', 'isCustomer', 'userName' |
|
|
|
|
]), |
|
|
|
|
...mapState('auth', [ |
|
|
|
|
'routes' |
|
|
|
@ -131,11 +129,11 @@ export default { |
|
|
|
|
this.$get(this.api.userInfo).then(res => { |
|
|
|
|
let userInfo = res.userInfo ? res.userInfo : {} |
|
|
|
|
let userAccount = res.userAccount |
|
|
|
|
this.userName = userAccount.account |
|
|
|
|
this.id = userAccount.id |
|
|
|
|
this.schoolName = res.schoolName |
|
|
|
|
this.setInfo({ |
|
|
|
|
avatar: userInfo.userAvatars |
|
|
|
|
avatar: userInfo.userAvatars, |
|
|
|
|
userName: userAccount.account |
|
|
|
|
}) |
|
|
|
|
}).catch(err => { }) |
|
|
|
|
}, |
|
|
|
|