Skip to content

Commit e6dd1c8

Browse files
committed
fix通讯录头像渲染bug
1 parent b93318f commit e6dd1c8

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

src/components/alivelist.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,12 @@ import pinyin from 'pinyin'
6767
if(pinyin(item.username, {style: pinyin.STYLE_NORMAL})[0][0].charAt(0).toUpperCase() == findSym) {
6868
if(!status) {
6969
addedList.push(findSym)
70+
console.log('item', item.url, index)
7071
addedList.push(item)
7172
status = true
7273
} else {
7374
addedList.push(item)
75+
console.log('item', item.url, index)
7476
}
7577
} else {
7678
findSym = pinyin(item.username, {style: pinyin.STYLE_NORMAL})[0][0].charAt(0).toUpperCase()

src/components/user.vue

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -79,24 +79,24 @@ import settings from '../settings.js'
7979
}
8080
if(!norepeatFriend) {
8181
this.show = false
82-
console.log('result.url', result.url)
83-
result.friendslist.push({
84-
username: this.loginId,
85-
url: result.url
86-
})
87-
let new_user = {
88-
_id: result._id,
89-
friendslist: result.friendslist
90-
}
91-
this.$http.post(settings.server + '/updateUser', new_user).then((res) => {
92-
let result = res.data
93-
})
9482
this.$http.post(settings.server + '/getUserInfo', { username: this.loginId }).then((res) => {
9583
let login_result = res.data.data.user
96-
console.log('login_result.url',login_result.url)
84+
85+
result.friendslist.push({
86+
username: this.loginId,
87+
url: login_result.url
88+
})
89+
let new_user = {
90+
_id: result._id,
91+
friendslist: result.friendslist
92+
}
93+
this.$http.post(settings.server + '/updateUser', new_user).then((res) => {
94+
let result = res.data
95+
})
96+
9797
login_result.friendslist.push({
9898
username: this.add_friend,
99-
url: login_result.url
99+
url: result.url
100100
})
101101
let new_login = {
102102
_id: login_result._id,

0 commit comments

Comments
 (0)