Commit 058ab68c by Sixong.Zhu

update

parent dc8f7637
Showing with 13 additions and 14 deletions
...@@ -23,9 +23,8 @@ import { RootStoreState } from "@/store/model"; ...@@ -23,9 +23,8 @@ import { RootStoreState } from "@/store/model";
export const ns = ChatStore.ns; export const ns = ChatStore.ns;
const sdk = Chat.getSdk;
const UniplatChatModelName = "UniplatChat"; const UniplatChatModelName = "UniplatChat";
const model = () => sdk().model(UniplatChatModelName); const model = () => Chat.getSdk().model(UniplatChatModelName);
const orgId = () => Chat.getOrgId() as string; const orgId = () => Chat.getOrgId() as string;
function uniqueMessages( function uniqueMessages(
...@@ -487,7 +486,7 @@ export default { ...@@ -487,7 +486,7 @@ export default {
if (uniplatId == null) return; if (uniplatId == null) return;
try { try {
const chat = getters[ChatStore.GETTER_CURRENT_CURRENT_CHAT]; const chat = getters[ChatStore.GETTER_CURRENT_CURRENT_CHAT];
const data = await sdk() const data = await Chat.getSdk()
.model(chat.model_name) .model(chat.model_name)
.chat(Number(chat.obj_id), orgId()) .chat(Number(chat.obj_id), orgId())
.sendMsg(params.msgType, params.msg); .sendMsg(params.msgType, params.msg);
...@@ -525,7 +524,7 @@ export default { ...@@ -525,7 +524,7 @@ export default {
{ commit, dispatch }, { commit, dispatch },
params: Parameters<ChatStore.ACTION_CREATE_NEW_CHAT_BY_SERVICE_MAN>[0] params: Parameters<ChatStore.ACTION_CREATE_NEW_CHAT_BY_SERVICE_MAN>[0]
) { ) {
const { imChatId } = await sdk() const { imChatId } = await Chat.getSdk()
.model(params.modelName) .model(params.modelName)
.chat(+params.selectedListId, orgId()) .chat(+params.selectedListId, orgId())
.createChat(); .createChat();
...@@ -541,7 +540,7 @@ export default { ...@@ -541,7 +540,7 @@ export default {
{ commit, dispatch }, { commit, dispatch },
params: Parameters<ChatStore.ACTION_CREATE_NEW_CHAT_BY_CLIENT>[0] params: Parameters<ChatStore.ACTION_CREATE_NEW_CHAT_BY_CLIENT>[0]
) { ) {
const { imChatId } = await sdk() const { imChatId } = await Chat.getSdk()
.model(params.modelName) .model(params.modelName)
.chat(+params.selectedListId, orgId()) .chat(+params.selectedListId, orgId())
.createChat(true); .createChat(true);
...@@ -632,7 +631,7 @@ export default { ...@@ -632,7 +631,7 @@ export default {
} }
if (!state[ChatStore.STATE_CHAT_CURRENT_USER_UID]) { if (!state[ChatStore.STATE_CHAT_CURRENT_USER_UID]) {
const userInfo = await sdk().getUserInfo(); const userInfo = await Chat.getSdk().getUserInfo();
commit(ChatStore.MUTATION_SET_CURRENT_USER_UID, userInfo.id); commit(ChatStore.MUTATION_SET_CURRENT_USER_UID, userInfo.id);
} }
...@@ -749,7 +748,7 @@ export default { ...@@ -749,7 +748,7 @@ export default {
const { model_name, obj_id } = currentChat; const { model_name, obj_id } = currentChat;
if (model_name == null) return; if (model_name == null) return;
if (obj_id == null) return; if (obj_id == null) return;
return await sdk() return await Chat.getSdk()
.model(model_name) .model(model_name)
.chat(obj_id, orgId()) .chat(obj_id, orgId())
.startChat() .startChat()
...@@ -761,7 +760,7 @@ export default { ...@@ -761,7 +760,7 @@ export default {
const { model_name, obj_id } = currentChat; const { model_name, obj_id } = currentChat;
if (model_name == null) return; if (model_name == null) return;
if (obj_id == null) return; if (obj_id == null) return;
return await sdk() return await Chat.getSdk()
.model(model_name) .model(model_name)
.chat(obj_id, orgId()) .chat(obj_id, orgId())
.finishChat() .finishChat()
...@@ -773,7 +772,7 @@ export default { ...@@ -773,7 +772,7 @@ export default {
const { model_name, obj_id } = currentChat; const { model_name, obj_id } = currentChat;
if (model_name == null) return; if (model_name == null) return;
if (obj_id == null) return; if (obj_id == null) return;
return await sdk() return await Chat.getSdk()
.model(model_name) .model(model_name)
.chat(obj_id, orgId()) .chat(obj_id, orgId())
.userExitChat() .userExitChat()
...@@ -785,7 +784,7 @@ export default { ...@@ -785,7 +784,7 @@ export default {
const { model_name, obj_id } = currentChat; const { model_name, obj_id } = currentChat;
if (model_name == null) return; if (model_name == null) return;
if (obj_id == null) return; if (obj_id == null) return;
return await sdk() return await Chat.getSdk()
.model(model_name) .model(model_name)
.chat(obj_id, orgId()) .chat(obj_id, orgId())
.csExitChat() .csExitChat()
...@@ -800,7 +799,7 @@ export default { ...@@ -800,7 +799,7 @@ export default {
const { model_name, obj_id } = currentChat; const { model_name, obj_id } = currentChat;
if (model_name == null) return; if (model_name == null) return;
if (obj_id == null) return; if (obj_id == null) return;
return await sdk() return await Chat.getSdk()
.model(model_name) .model(model_name)
.chat(obj_id, orgId()) .chat(obj_id, orgId())
.addMember(uids.map((id) => Number(id))) .addMember(uids.map((id) => Number(id)))
...@@ -815,7 +814,7 @@ export default { ...@@ -815,7 +814,7 @@ export default {
const { model_name, obj_id } = currentChat; const { model_name, obj_id } = currentChat;
if (model_name == null) return; if (model_name == null) return;
if (obj_id == null) return; if (obj_id == null) return;
return await sdk() return await Chat.getSdk()
.model(model_name) .model(model_name)
.chat(obj_id, orgId()) .chat(obj_id, orgId())
.removeMember(uids.map((id) => Number(id))) .removeMember(uids.map((id) => Number(id)))
...@@ -830,7 +829,7 @@ export default { ...@@ -830,7 +829,7 @@ export default {
const { model_name, obj_id } = currentChat; const { model_name, obj_id } = currentChat;
if (model_name == null) return; if (model_name == null) return;
if (obj_id == null) return; if (obj_id == null) return;
return await sdk() return await Chat.getSdk()
.model(model_name) .model(model_name)
.chat(obj_id, orgId()) .chat(obj_id, orgId())
.addCs(uids.map((id) => Number(id))) .addCs(uids.map((id) => Number(id)))
...@@ -845,7 +844,7 @@ export default { ...@@ -845,7 +844,7 @@ export default {
const { model_name, obj_id } = currentChat; const { model_name, obj_id } = currentChat;
if (model_name == null) return; if (model_name == null) return;
if (obj_id == null) return; if (obj_id == null) return;
return await sdk() return await Chat.getSdk()
.model(model_name) .model(model_name)
.chat(obj_id, orgId()) .chat(obj_id, orgId())
.removeCs(uids.map((id) => Number(id))) .removeCs(uids.map((id) => Number(id)))
......
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