|
@@ -130,8 +130,8 @@ const wsMessage = async (data) => {
|
|
|
const dataJson = data
|
|
|
if (dataJson && dataJson._id) {
|
|
|
if (
|
|
|
- (dataJson.sender_id == user.value._id && dataJson.receiver_id == id.value) ||
|
|
|
- (dataJson.sender_id == id.value && dataJson.receiver_id == user.value._id)
|
|
|
+ (dataJson.sender_id == user.value.id && dataJson.receiver_id == id.value) ||
|
|
|
+ (dataJson.sender_id == id.value && dataJson.receiver_id == user.value.id)
|
|
|
) {
|
|
|
await searchList()
|
|
|
list.value.push(dataJson)
|
|
@@ -164,7 +164,7 @@ const searchList = async () => {
|
|
|
const toView = async (item) => {
|
|
|
id.value = item._id
|
|
|
info.value = item
|
|
|
- await chatstore.read({ sender_id: user.value._id, receiver_id: id.value })
|
|
|
+ await chatstore.read({ sender_id: user.value.id, receiver_id: id.value })
|
|
|
await searchList()
|
|
|
await searchChat({ skip, limit })
|
|
|
}
|
|
@@ -181,7 +181,7 @@ const searchChat = async (query = { skip: 0, limit }) => {
|
|
|
}
|
|
|
const toSend = async () => {
|
|
|
const data = {
|
|
|
- sender_id: user.value._id,
|
|
|
+ sender_id: user.value.id,
|
|
|
receiver_id: id.value,
|
|
|
type: '0',
|
|
|
content: textarea.value,
|