zdg #176

Merged
zhengdegang merged 2 commits from zdg into main 2024-09-05 16:32:58 +08:00
2 changed files with 5 additions and 3 deletions

View File

@ -13,6 +13,7 @@ import IMListeners from './imLiseners' // im消息-监听器
const API = window.api
// TIM生成签名
// import * as GenerateUserSig from './userSig' // 引入签名生成器
const isDev = process.env.NODE_ENV == 'development' // 环境
export class ImChat {
timChat // imChat对象
SDKAppID // sdkID
@ -48,10 +49,11 @@ export class ImChat {
}
// 设置配置
async setConfig() {
const log_level = TYPES.TIMLogLevel.kTIMLog_Error
await this.timChat.TIMSetConfig({ // TIMSetConfigParam
json_config: { // JSONCongfig
set_config_log_level: TYPES.TIMLogLevel.kTIMLog_Test,
set_config_callback_log_level: TYPES.TIMLogLevel.kTIMLog_Error,
set_config_log_level: log_level,
set_config_callback_log_level: log_level,
set_config_is_log_output_console: true,
// set_config_user_config: { // 用户配置
// user_config_is_read_receipt: true, // true表示要收已读回执事件

View File

@ -95,7 +95,7 @@ const getClassInfo = async () => {
const { data } = await classManageApi.getClassInfo(classObj.id)
classObj.data = data
// id
let timGroupId = data?.ex3 || '@TGS#36AICW6O6'
let timGroupId = data?.ex3 || ''
console.log('获取群ID:', timGroupId)
const chat = await imChatRef.value?.initImChat(timGroupId) // im-chat
if (!timGroupId) timGroupId = chat?.timGroupId