From 648904d076ae6e17892b40675598b1c8dc474277 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Fri, 24 Apr 2026 16:21:12 +0800
Subject: [PATCH] Merge branch 'feature/v9.0/9.0.3' into feature/v9.0/9.0.4
---
src/components/WebViewPlus.vue | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/components/WebViewPlus.vue b/src/components/WebViewPlus.vue
index 47d5d01..a6ca687 100644
--- a/src/components/WebViewPlus.vue
+++ b/src/components/WebViewPlus.vue
@@ -1,8 +1,12 @@
<template>
- <web-view :src="src" @message="viewMessage" />
+ <web-view :src="src" @message="viewMessage" :allow="allow"/>
</template>
+
<script setup>
+
+
+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 +20,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",
});
}
@@ -28,6 +33,13 @@
}
}
+
+onLoad((obj) => {
+ // const h5Params = obj?.cs && JSON.parse(obj?.cs)
+ // console.log('h5Params', h5Params)
+ // h5Params && viewMessage({detail: {data: [h5Params.data]}})
+})
+
onShow(() => {
if (window && window.addEventListener)
window.addEventListener("message", messageFun);
--
Gitblit v1.9.3