Commit 172f027c by panjiangyi

当前会话的人的id

parent 0a7084f1
......@@ -235,27 +235,29 @@ export default class Message extends Mixins(Filters) {
return true;
}
const senderEid = Number(this.messageBody.eid);
if (this.messageBody) {
const msg = this.messageBody;
if (this.chatSource) {
const source = msg.msg.source;
if (source) {
return (
source === this.chatSource && this.messageBody.eid === this.chatMyId
source === this.chatSource && senderEid === this.chatMyId
);
}
if (this.org && this.messageBody.oid) {
return (
this.messageBody.oid === this.org &&
this.messageBody.eid === this.chatMyId
senderEid === this.chatMyId
);
}
return false;
}
return this.messageBody.eid === this.chatMyId;
return senderEid === this.chatMyId;
}
return false;
......
......@@ -152,7 +152,8 @@ export default {
[ChatStore.MUTATION_SAVE_MYSELF_ID](state) {
Chat.getToken().then((token) => {
const eid = decode(token);
state[ChatStore.STATE_CHAT_MY_ID] = eid.eid || eid.sub;
console.log("fuck", eid);
state[ChatStore.STATE_CHAT_MY_ID] = eid.user_id;
state[ChatStore.STATE_CHAT_MY_UID] = eid.sub;
});
},
......@@ -264,7 +265,7 @@ export default {
if (chatId == null) return;
if (payload.chat_id !== chatId) return;
const arr = state[ChatStore.STATE_CURRENT_CHAT_INPUTING];
const eid = payload.eid;
const eid = Number(payload.eid);
if (eid === state[ChatStore.STATE_CHAT_MY_ID]) return;
if (arr.includes(eid)) {
window.clearTimeout(setTimeoutId[eid]);
......
......@@ -47,7 +47,7 @@ export namespace ChatStore {
export type STATE_CHAT_CURRENT_CHAT_UNIPLAT_ID = string | null
export const STATE_CHAT_MY_ID = "聊天窗口显示在右边那个人的id";
export type STATE_CHAT_MY_ID = string | null
export type STATE_CHAT_MY_ID = number | null
export const STATE_CHAT_MY_UID = "聊天窗口显示在右边那个人的uid";
export type STATE_CHAT_MY_UID = string | null
......@@ -55,7 +55,7 @@ export namespace ChatStore {
export type STATE_CHAT_SOURCE = StateChatSourceDirection
export const STATE_CURRENT_CHAT_INPUTING = "当前会话正在输入的人";
export type STATE_CURRENT_CHAT_INPUTING = string[]
export type STATE_CURRENT_CHAT_INPUTING = number[]
export const STATE_CURRENT_CHAT_INITING = "当前会是否正在初始化";
export type STATE_CURRENT_CHAT_INITING = boolean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment