获取好友信息的时候,排除自己,但是还要把自己的信息加载到内存中

This commit is contained in:
2022-02-28 10:26:48 +08:00
parent 3e1275fc74
commit e8e496cf37
4 changed files with 10 additions and 6 deletions

View File

@@ -6,7 +6,7 @@ import {
export default {
state: {
contacts: {},
myInfo: {}
myInfo: {}
},
getters: {
contacts(state) {
@@ -41,6 +41,7 @@ export default {
updateContactInfo(state, contactInfo) {
Vue.set(state.contacts, contactInfo.targetId, contactInfo)
},
// 设置我的资料
setSenderInfo(state, contactInfo) {
state.myInfo = {
userId: contactInfo.targetId,
@@ -69,8 +70,11 @@ export default {
})
},
setSenderInfo({
commit
}, contactInfo) {
commit,
dispatch
}, contactInfo) {
contactInfo.type = 0 // type 更改为0标记是我自己
dispatch('updateContact', contactInfo)
commit('setSenderInfo', contactInfo)
},
// 载入好友信息