From 4fa6bcd50fce17e83ed5b20a24a7e9de8098a324 Mon Sep 17 00:00:00 2001 From: laoguanyao <806103474@qq.com> Date: Sat, 27 Jul 2024 11:30:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9flutter=5Finappwebview?= =?UTF-8?q?=E4=BD=BF=E7=94=A8initialFile=E6=97=A0=E6=B3=95=E5=8A=A0?= =?UTF-8?q?=E8=BD=BDasset=E6=96=87=E4=BB=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: laoguanyao <806103474@qq.com> --- .../plugin/webview/in_app_webview/InAppWebView.ets | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flutter_inappwebview_ohos/ohos/src/main/ets/components/plugin/webview/in_app_webview/InAppWebView.ets b/flutter_inappwebview_ohos/ohos/src/main/ets/components/plugin/webview/in_app_webview/InAppWebView.ets index ba6fc497..40531790 100644 --- a/flutter_inappwebview_ohos/ohos/src/main/ets/components/plugin/webview/in_app_webview/InAppWebView.ets +++ b/flutter_inappwebview_ohos/ohos/src/main/ets/components/plugin/webview/in_app_webview/InAppWebView.ets @@ -269,9 +269,10 @@ export default class InAppWebView implements InAppWebViewInterface { if (this.plugin == null) { return; } - this.curUrl = assetFilePath; + let realUrl = $rawfile("flutter_assets/" + assetFilePath) + this.curUrl = realUrl; await this.waitControllerAttached(); - this.controller.loadUrl(assetFilePath) + this.controller.loadUrl(realUrl) } getLoadUrl(): string | Resource { -- Gitee