Commit 66487887 by Sixong.Zhu

Merge branch 'master' into pre

parents 6babc727 146f6c8e
Showing with 23 additions and 21 deletions
......@@ -363,7 +363,11 @@
}
// 系统推送的消息或老用户(一般是客服,eid为负数),默认为客服发送
if (this.messageBody && +this.messageBody.eid <= 0) {
if (
this.messageBody &&
this.messageBody.eid &&
+this.messageBody.eid <= 0
) {
return true;
}
......
import Chat from "../xim";
import { orderService } from '../service/order';
import { orderService } from "../service/order";
export type ChatInfo = {
[eid: string]: any;
......@@ -10,7 +10,8 @@ const chatInfo: ChatInfo = {};
export const getChatModel = () => chatInfo;
const loadingKeys = new Set<string>();
let waitingAction: { key: string; resolve: (d: ChatModelInfoData) => void }[] = [];
let waitingAction: { key: string; resolve: (d: ChatModelInfoData) => void }[] =
[];
export interface ChatModelInfoData {
uniplatId: string | number;
......@@ -25,7 +26,10 @@ function buildCache() {
if (!model2DetailNameMapping.size) {
// 用户端默认不使用chat内置的detailName(这个专属于服务端),所以这里加一层内置转换
if (!Chat.isBackend()) {
model2DetailNameMapping.set(orderService.generalOrder, orderService.generalOrderDefaultDetailName);
model2DetailNameMapping.set(
orderService.generalOrder,
orderService.generalOrderDefaultDetailName
);
}
}
}
......@@ -57,12 +61,6 @@ export async function getChatModelInfo(
data: d,
} as ChatModelInfoData);
}
return Promise.resolve({
uniplatId: 0,
chat_id: 0,
uniplat_version: 0,
data: d,
});
}
loadingKeys.add(key);
......@@ -71,23 +69,23 @@ export async function getChatModelInfo(
.detail(id + "", detail)
.query();
const data = info;
chatInfo[key] = data;
info && info.row.UniplatChatId && (chatInfo[key] = data);
loadingKeys.delete(key);
const o = (
info.row && info.row.UniplatChatId
? {
uniplatId: info.row.UniplatChatId.value,
chat_id: +(info.row.UniplatImChatId.value as string),
uniplat_version: 0,
data,
}
uniplatId: info.row.UniplatChatId.value,
chat_id: +(info.row.UniplatImChatId.value as string),
uniplat_version: 0,
data,
}
: {
uniplatId: 0,
chat_id: 0,
uniplat_version: 0,
data,
}
uniplatId: 0,
chat_id: 0,
uniplat_version: 0,
data,
}
) as ChatModelInfoData;
let removing = [];
......
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