Skip to content

Commit

Permalink
Merge pull request iview#1205 from baiyutang/master
Browse files Browse the repository at this point in the history
fix wrongly written character avator
  • Loading branch information
icarusion authored Mar 7, 2019
2 parents 5a86680 + d5193dc commit ade4e82
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/components/main/components/user/user.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.user{
&-avator-dropdown{
&-avatar-dropdown{
cursor: pointer;
display: inline-block;
// height: 64px;
Expand Down
6 changes: 3 additions & 3 deletions src/components/main/components/user/user.vue
Original file line number Diff line number Diff line change
@@ -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">
Expand All @@ -21,7 +21,7 @@ import { mapActions } from 'vuex'
export default {
name: 'User',
props: {
userAvator: {
userAvatar: {
type: String,
default: ''
},
Expand Down
6 changes: 3 additions & 3 deletions src/components/main/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;"/>
Expand Down Expand Up @@ -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) : []]
Expand Down
4 changes: 2 additions & 2 deletions src/mock/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/store/module/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default {
state: {
userName: '',
userId: '',
avatorImgPath: '',
avatarImgPath: '',
token: getToken(),
access: '',
hasGetInfo: false,
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ade4e82

Please sign in to comment.