diff --git a/src/main/chat.js b/src/main/chat.js
index b6700f2..21bf021 100644
--- a/src/main/chat.js
+++ b/src/main/chat.js
@@ -3,7 +3,7 @@
*/
// import { ipcMain } from 'electron'
// const TimMain = require('im_electron_sdk/dist/main')
-import TimMain from 'im_electron_sdk/dist/main'
+// import TimMain from 'im_electron_sdk/dist/main'
// import {TIMErrCode} from 'im_electron_sdk/dist/enumbers'
const sdkappidDef = 1600034736 // 可以去腾讯云即时通信IM控制台申请
diff --git a/src/main/index.js b/src/main/index.js
index aff4dde..3f74810 100644
--- a/src/main/index.js
+++ b/src/main/index.js
@@ -3,7 +3,7 @@ import { join } from 'path'
import { electronApp, optimizer, is } from '@electron-toolkit/utils'
import icon from '../../resources/icon.png?asset'
import File from './file'
-import chat from './chat' // chat封装
+// import chat from './chat' // chat封装
// 代理 electron/remote
// 第一步:引入remote
import remote from '@electron/remote/main'
@@ -230,15 +230,14 @@ app.on('window-all-closed', () => {
// 监听全局事件
function handleAll() {
- // chat.initialize() // im-chat 实例
- const chatInstance = chat.initialize() // im-chat 实例
+ // const chatInstance = chat.initialize() // im-chat 实例
// 新窗口创建-监听
ipcMain.on('new-window', (e, data) => {
const { id, type } = data
const win = BrowserWindow.fromId(id)
win.type = type // 绑定独立标识
remote.enable(win.webContents) // 开启远程服务
- chatInstance.enable(win.webContents) // 开启im-chat
+ // chatInstance.enable(win.webContents) // 开启im-chat
})
// 用于监听-状态管理变化-同步所有窗口
ipcMain.handle('pinia-state-change', (e, storeName, jsonStr) => {
diff --git a/src/preload/index.js b/src/preload/index.js
index ffdb7a0..a840ca5 100644
--- a/src/preload/index.js
+++ b/src/preload/index.js
@@ -1,10 +1,10 @@
import { contextBridge } from 'electron'
import { electronAPI } from '@electron-toolkit/preload'
-import TimRender from 'im_electron_sdk/dist/renderer' // im渲染部分实例
+// import TimRender from 'im_electron_sdk/dist/renderer' // im渲染部分实例
// Custom APIs for renderer
const api = {
preloadPath: __dirname, // 当前preload地址
- getTimRender: () => new TimRender(), // im渲染部分实例
+ // getTimRender: () => new TimRender(), // im渲染部分实例
}
// Use `contextBridge` APIs to expose Electron APIs to
// renderer only if context isolation is enabled, otherwise
diff --git a/src/renderer/src/plugins/imChat/index.js b/src/renderer/src/plugins/imChat/index.js
index 4257f69..60d1a92 100644
--- a/src/renderer/src/plugins/imChat/index.js
+++ b/src/renderer/src/plugins/imChat/index.js
@@ -74,7 +74,9 @@ export class ImChat {
try {
if(!API) reject('preload api获取失败, 初始化-未完成')
this.timChat = await API.getTimRender()
- await this.timChat.TIMInit()
+ await this.timChat.TIMInit({
+ // electron_log:true,
+ })
console.log('[im-chat]:初始化成功')
this.status.isConnect = true
this.setConfig() // 设置日志级别
@@ -150,6 +152,7 @@ export class ImChat {
return this.timChat.TIMLogout().then(res => {
console.log('登出成功', res)
this.status.isLogin = false
+ this.timChat.TIMUninit() // 反初始化
return res
}).catch(error => {
console.log('登出失败', error)
diff --git a/src/renderer/src/views/tool/sphere.vue b/src/renderer/src/views/tool/sphere.vue
index 7b018d9..f6443ac 100644
--- a/src/renderer/src/views/tool/sphere.vue
+++ b/src/renderer/src/views/tool/sphere.vue
@@ -10,7 +10,7 @@