From 324270b201031fedaa298bdc873423e442df5993 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Tue, 11 Nov 2025 16:58:39 +0800
Subject: [PATCH] feat: 一定要写条件编译

---
 src/components/WebViewPlus.vue |    4 ++++
 src/App.vue                    |    5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/App.vue b/src/App.vue
index 26d39bf..498f372 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -3,7 +3,9 @@
 import {useAppStore, useUserStore} from "@/store";
 import {mpUpdate} from "@/utils/index";
 import {genTestUserSig} from '@/utils/voiceCallByTX/GenerateTestUserSig.js';
-import { TUICallKit, TUICallKitAPI, CallMediaType } from '@trtc/calls-uikit-vue'
+// #ifdef H5
+import {  TUICallKitAPI } from '@trtc/calls-uikit-vue'
+// #endif
 const appStore = useAppStore();
 const userStore = useUserStore();
 
@@ -43,7 +45,6 @@
   if (!userId.value) return
   // #ifdef H5
   initVoiceCallFromH5()
-  console.log(userId.value)
   // #endif
 
   // #ifdef APP-PLUS
diff --git a/src/components/WebViewPlus.vue b/src/components/WebViewPlus.vue
index c53d4b7..6052042 100644
--- a/src/components/WebViewPlus.vue
+++ b/src/components/WebViewPlus.vue
@@ -1,10 +1,14 @@
 <template>
   <web-view :src="src" @message="viewMessage" :allow="allow"/>
+  #ifdef H5
   <TUICallKit/>
+  #endif
 </template>
 
 <script setup>
+// #ifdef H5
 import {TUICallKit} from "@trtc/calls-uikit-vue";
+// #endif
 
 const allow = "accelerometer;ambient-light-sensor;autoplay;battery;camera;clipboard-read;clipboard-write;cross-origin-isolated;display-capture;document-domain;encrypted-media;execution-while-not-rendered;execution-while-out-of-viewport;fullscreen;gamepad;geolocation;gyroscope;hid;idle-detection;local-fonts;magnetometer;microphone;midi;payment;picture-in-picture;publickey-credentials-get;screen-wake-lock;serial;speaker-selection;storage-access;sync-xhr;usb;web-share;xr-spatial-tracking"
 const src = defineModel("src");

--
Gitblit v1.9.3