avator => avatar
This commit is contained in:
parent
5a866808b3
commit
d5193dc265
|
|
@ -1,5 +1,5 @@
|
|||
.user{
|
||||
&-avator-dropdown{
|
||||
&-avatar-dropdown{
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
// height: 64px;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<template>
|
||||
<div class="user-avator-dropdown">
|
||||
<div class="user-avatar-dropdown">
|
||||
<Dropdown @on-click="handleClick">
|
||||
<Badge :dot="!!messageUnreadCount">
|
||||
<Avatar :src="userAvator"/>
|
||||
<Avatar :src="userAvatar"/>
|
||||
</Badge>
|
||||
<Icon :size="18" type="md-arrow-dropdown"></Icon>
|
||||
<DropdownMenu slot="list">
|
||||
|
|
@ -21,7 +21,7 @@ import { mapActions } from 'vuex'
|
|||
export default {
|
||||
name: 'User',
|
||||
props: {
|
||||
userAvator: {
|
||||
userAvatar: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
<Layout>
|
||||
<Header class="header-con">
|
||||
<header-bar :collapsed="collapsed" @on-coll-change="handleCollapsedChange">
|
||||
<user :message-unread-count="unreadCount" :user-avator="userAvator"/>
|
||||
<user :message-unread-count="unreadCount" :user-avatar="userAvatar"/>
|
||||
<language v-if="$config.useI18n" @on-lang-change="setLocal" style="margin-right: 10px;" :lang="local"/>
|
||||
<error-store v-if="$config.plugin['error-store'] && $config.plugin['error-store'].showInHeader" :has-read="hasReadErrorPage" :count="errorCount"></error-store>
|
||||
<fullscreen v-model="isFullscreen" style="margin-right: 10px;"/>
|
||||
|
|
@ -79,8 +79,8 @@ export default {
|
|||
tagRouter () {
|
||||
return this.$store.state.app.tagRouter
|
||||
},
|
||||
userAvator () {
|
||||
return this.$store.state.user.avatorImgPath
|
||||
userAvatar () {
|
||||
return this.$store.state.user.avatarImgPath
|
||||
},
|
||||
cacheList () {
|
||||
const list = ['ParentView', ...this.tagNavList.length ? this.tagNavList.filter(item => !(item.meta && item.meta.notCache)).map(item => item.name) : []]
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@ const USER_MAP = {
|
|||
user_id: '1',
|
||||
access: ['super_admin', 'admin'],
|
||||
token: 'super_admin',
|
||||
avator: 'https://file.iviewui.com/dist/a0e88e83800f138b94d2414621bd9704.png'
|
||||
avatar: 'https://file.iviewui.com/dist/a0e88e83800f138b94d2414621bd9704.png'
|
||||
},
|
||||
admin: {
|
||||
name: 'admin',
|
||||
user_id: '2',
|
||||
access: ['admin'],
|
||||
token: 'admin',
|
||||
avator: 'https://avatars0.githubusercontent.com/u/20942571?s=460&v=4'
|
||||
avatar: 'https://avatars0.githubusercontent.com/u/20942571?s=460&v=4'
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ export default {
|
|||
state: {
|
||||
userName: '',
|
||||
userId: '',
|
||||
avatorImgPath: '',
|
||||
avatarImgPath: '',
|
||||
token: getToken(),
|
||||
access: '',
|
||||
hasGetInfo: false,
|
||||
|
|
@ -26,8 +26,8 @@ export default {
|
|||
messageContentStore: {}
|
||||
},
|
||||
mutations: {
|
||||
setAvator (state, avatorPath) {
|
||||
state.avatorImgPath = avatorPath
|
||||
setAvatar (state, avatarPath) {
|
||||
state.avatarImgPath = avatarPath
|
||||
},
|
||||
setUserId (state, id) {
|
||||
state.userId = id
|
||||
|
|
@ -111,7 +111,7 @@ export default {
|
|||
try {
|
||||
getUserInfo(state.token).then(res => {
|
||||
const data = res.data
|
||||
commit('setAvator', data.avator)
|
||||
commit('setAvatar', data.avatar)
|
||||
commit('setUserName', data.name)
|
||||
commit('setUserId', data.user_id)
|
||||
commit('setAccess', data.access)
|
||||
|
|
|
|||
Loading…
Reference in New Issue