Commit 39bbc202 by Sixong.Zhu

cs

parent 474ad190
...@@ -3,6 +3,7 @@ import { parserMessage } from "."; ...@@ -3,6 +3,7 @@ import { parserMessage } from ".";
import { chatStore, ChatStore } from "@/customer-service/store/model"; import { chatStore, ChatStore } from "@/customer-service/store/model";
import { formatTime, TimeFormatRule } from "@/customer-service/utils/time"; import { formatTime, TimeFormatRule } from "@/customer-service/utils/time";
import { Chat as ChatItem } from "@/customer-service/xim/models/chat"; import { Chat as ChatItem } from "@/customer-service/xim/models/chat";
import Xim from "@/customer-service/xim";
@Component({ components: {} }) @Component({ components: {} })
export default class ChatList extends Vue { export default class ChatList extends Vue {
...@@ -48,11 +49,13 @@ export default class ChatList extends Vue { ...@@ -48,11 +49,13 @@ export default class ChatList extends Vue {
@chatStore.Action(ChatStore.ACTION_CLEAR_CURRENT_CHAT_DATA) @chatStore.Action(ChatStore.ACTION_CLEAR_CURRENT_CHAT_DATA)
protected readonly reset!: ChatStore.ACTION_CLEAR_CURRENT_CHAT_DATA; protected readonly reset!: ChatStore.ACTION_CLEAR_CURRENT_CHAT_DATA;
private readonly invoker = Xim.getSdk();
protected parseMesage(data: ChatItem) { protected parseMesage(data: ChatItem) {
if (data.last_msg_sender && data.last_msg_sender !== "0") { if (data.last_msg_sender && data.last_msg_sender !== "0") {
if (!this.userNames[data.last_msg_sender]) { if (!this.userNames[data.last_msg_sender]) {
this.updateUserName({ id: data.last_msg_sender, name: "" }); this.updateUserName({ id: data.last_msg_sender, name: "" });
this.sdk this.invoker
.model("user") .model("user")
.detail(data.last_msg_sender) .detail(data.last_msg_sender)
.query() .query()
...@@ -62,7 +65,7 @@ export default class ChatList extends Vue { ...@@ -62,7 +65,7 @@ export default class ChatList extends Vue {
name: userInfo.row.first_name.display as string, name: userInfo.row.first_name.display as string,
}); });
}) })
.catch(() => {}); .catch(() => { });
} }
} }
if (data.last_msg_content === "") { if (data.last_msg_content === "") {
......
import Vue from "vue"; import Chat from "@/customer-service/xim";
import { UniplatSdk } from "uniplat-sdk"
const orgId = () => Vue.prototype.global.org?.id ?? "0";
export async function uploadFile(file: File) { export async function uploadFile(file: File) {
let { url } = await (Vue.prototype.sdk as UniplatSdk).uploadFileV2(file) const sdk = Chat.getSdk();
const realUrl = `${Vue.prototype.sdk.global.baseUrl}${url}`; let { url } = await sdk.uploadFileV2(file)
return realUrl; return `${sdk.global.baseUrl}${url}`;
} }
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