Merge pull request 'zdg' (#332) from zdg into main

Reviewed-on: #332
This commit is contained in:
zhengdegang 2024-10-18 17:08:45 +08:00
commit e8763793a7
4 changed files with 9 additions and 6 deletions

View File

@ -285,8 +285,11 @@ export class ImChat {
// callback: (data) => {} // callback: (data) => {}
} }
// console.log('发送消息', option) // console.log('发送消息', option)
this.setConsole('%cim-chat: 发送消息', option) this.setConsole('%cim-chat: 发送消息【req】', conv_id, msg)
return this.timChat.TIMMsgSendMessageV2(option) return this.timChat.TIMMsgSendMessageV2(option).then(res => {
this.setConsole('%cim-chat: 发送消息【res】', JSON.stringify(res))
return res
})
} }
/** /**
* @description 发送群消息 * @description 发送群消息

View File

@ -128,7 +128,7 @@ const closeHomework = async() => {
const successHomework = (data)=>{ const successHomework = (data)=>{
// console.log('', data) // console.log('', data)
// im-(app|) // im-(app|)
ipcMsgInvoke('im-chat:msg', data, MsgEnum.HEADS.MSG_0016) // ipcMsgInvoke('im-chat:msg', data, MsgEnum.HEADS.MSG_0016)
} }
// change // change
const changeChapter = async (data)=>{ const changeChapter = async (data)=>{

View File

@ -12,7 +12,7 @@ const props = defineProps({
}) })
const imChatObj = reactive({imChat:null}) const imChatObj = reactive({imChat:null})
onMounted(() => { onMounted(() => {
ipcMainHandle() // -ipcMain im // ipcMainHandle() // -ipcMain im
}) })
// im-chat // im-chat
const initImChat = async (timGroupId) => { const initImChat = async (timGroupId) => {

View File

@ -105,7 +105,7 @@ const getClassInfo = async () => {
const chat = await imChatRef.value?.initImChat(timGroupId) // im-chat const chat = await imChatRef.value?.initImChat(timGroupId) // im-chat
if (!timGroupId) timGroupId = chat?.timGroupId if (!timGroupId) timGroupId = chat?.timGroupId
if (!timGroupId) return ElMessage.error('房间创建-失败') if (!timGroupId) return ElMessage.error('房间创建-失败')
classManageApi.startClass(classObj.id, timGroupId) // if (data.status != '上课中') classManageApi.startClass(classObj.id, timGroupId) //
} }
// tab-change // tab-change
const tabChange = (val) => { const tabChange = (val) => {
@ -158,7 +158,7 @@ const touchChange = (e) => {
const chatChange = (type, data, ...args) => { const chatChange = (type, data, ...args) => {
if (type == 'createGroup') { // - if (type == 'createGroup') { // -
console.log('创建群:', data) console.log('创建群:', data)
!!data && classManageApi.startClass(classObj.id, data) // !!data && classManageApi.startClass(classObj.id, data)
} else if (type == 'msg') { // im-chat } else if (type == 'msg') { // im-chat
if (!data) return // msg message_msg_id if (!data) return // msg message_msg_id
const msgId = (args||[])[0].message_msg_id const msgId = (args||[])[0].message_msg_id