caner 1 year ago
parent
commit
efe4c61ab7
3 changed files with 3 additions and 4 deletions
  1. 1 1
      src-tauri/src/lib.rs
  2. 1 1
      src/pages/room/component/mic.vue
  3. 1 2
      src/services/logi.service.ts

+ 1 - 1
src-tauri/src/lib.rs

@@ -13,7 +13,7 @@ const G923_PIDS: &[u16] = &[
     0xC266,  // G920(兼容检查)
     0xC266,  // G920(兼容检查)
 ];
 ];
 
 
-// 读取G923数据
+// 读取G923数据=>需要安装logtech G HUB 软件驱动
 #[tauri::command]
 #[tauri::command]
 fn start_reading_data(window: Window) -> Result<(), String> {
 fn start_reading_data(window: Window) -> Result<(), String> {
     // 初始化HID API
     // 初始化HID API

+ 1 - 1
src/pages/room/component/mic.vue

@@ -40,7 +40,7 @@ async function initMic() {
   } catch (error: any) {
   } catch (error: any) {
     console.log('录音错误', error)
     console.log('录音错误', error)
     const type = error.toString().includes('getUserMedia')
     const type = error.toString().includes('getUserMedia')
-    window.$notification.warning({ title: type ? '不支持webrtc音频' : '未获取到音频设备', duration: 2000 })
+    window.$notification.warning({ title: type ? '不支持webrtc音频' : '未获取到音频设备', duration: 5000 })
   }
   }
 }
 }
 
 

+ 1 - 2
src/services/logi.service.ts

@@ -8,14 +8,13 @@ export default class LogiService {
   init() {
   init() {
     invoke('start_reading_data').then(() => {
     invoke('start_reading_data').then(() => {
       listen('g923-data', (event: { payload: string }) => {
       listen('g923-data', (event: { payload: string }) => {
-        console.log(' G923 数据:', event)
         const data = this.parseG923Data(event.payload)
         const data = this.parseG923Data(event.payload)
         console.log('解析后的数据:', data)
         console.log('解析后的数据:', data)
         this.store.setMqttMessage({ type: 'control', data })
         this.store.setMqttMessage({ type: 'control', data })
       })
       })
     }).catch((er) => {
     }).catch((er) => {
       console.log('罗技eror', er)
       console.log('罗技eror', er)
-      window.$notification.error({ title: er })
+      window.$notification.error({ title: er, duration: 5000 })
     })
     })
   }
   }