From df2a71cf5feb914a9ca0540142bb6bf1865e26fb Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Thu, 13 Nov 2025 18:26:19 +0800
Subject: [PATCH] feat:未登录跳转登录页
---
src/components/WebViewPlus.vue | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/components/WebViewPlus.vue b/src/components/WebViewPlus.vue
index 47d5d01..d697186 100644
--- a/src/components/WebViewPlus.vue
+++ b/src/components/WebViewPlus.vue
@@ -1,8 +1,17 @@
<template>
- <web-view :src="src" @message="viewMessage" />
+ <web-view :src="src" @message="viewMessage" :allow="allow"/>
+ <!-- #ifdef WEB -->
+ <TUICallKit/>
+ <!-- #endif WEB -->
</template>
+
<script setup>
+// #ifdef WEB
+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");
const emit = defineEmits(["webMessage"]);
@@ -16,11 +25,12 @@
},
});
}
+
// WEB_INVOKE_APPSERVICE
function messageFun(e) {
if (e.data.type === "WEB_INVOKE_APPSERVICE") {
if (e.data.data.arg.type === "tokenExpired") {
- return uni.redirectTo({
+ return uni.reLaunch({
url: "/pages/login/index",
});
}
--
Gitblit v1.9.3