Commit 058ab68c by Sixong.Zhu

update

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