<WebView ref={webView => this.webView = webView}source={furi: config.API_BASE_URI +/mobile-backend/SignSDK/index.html'}}source={f'http://uygzacps.ydthlife.com/mobile-backend/signPage.html'}] mediaPlaybackRequiresUserAction={false]onMessage={(e) => this.onMessage(e)} startInLoadingState={true} automaticallyAdjustContentInsets={truelscalesPageToFit=true} style={{width:100%', flex: 1}} bounces={false} scrollEnabled={true} injectedJavaScript={this.signOnLoad()} contentInset={{top: , left: , right: 0, bottom: 0}}/>无法访问html报错Can't open url: cloudwise-agent:

时间: 2024-04-25 10:27:13 浏览: 5
根据你提供的代码,我发现 WebView 组件的 "source" 属性存在一些问题,可能导致 URL 地址无法正常加载。具体的问题在于,你同时在 "source" 属性中设置了一个 "furi" 和一个 "source" 属性,这样会导致 WebView 组件无法正确解析 URL。另外,如果你的 H5 页面中使用了某些非标准的 URL Scheme 或者协议(比如 "cloudwise-agent"),WebView 组件会默认禁止访问这些 URL,需要你手动设置 "originWhitelist" 属性来允许访问。 为了解决这个问题,你可以尝试修改代码如下: ``` <WebView ref={webView => this.webView = webView} source={{ uri: 'http://uygzacps.ydthlife.com/mobile-backend/signPage.html' }} mediaPlaybackRequiresUserAction={false} onMessage={(e) => this.onMessage(e)} startInLoadingState={true} automaticallyAdjustContentInsets={true} scalesPageToFit={true} style={{ width: '100%', flex: 1 }} bounces={false} scrollEnabled={true} injectedJavaScript={this.signOnLoad()} originWhitelist={['http://*', 'https://*', 'file://*', 'cloudwise-agent:*']} contentInset={{ top: 0, left: 0, right: 0, bottom: 0 }} /> ``` 在这个例子中,我们将 "source" 属性设置为一个对象,其中 "uri" 字段指定了要加载的 URL 地址。我们还添加了 "scalesPageToFit" 属性来允许页面自适应屏幕大小。另外,我们也设置了 "originWhitelist" 属性来允许访问 "cloudwise-agent" 协议的 URL。你可以根据实际情况修改 "originWhitelist" 属性的值,以满足你的需求。

相关推荐

Command line: -prefix /home/liuyh/workspace/qt5.14.2-arm -opensource -confirm-license -release -strip -shared -xplatform linux-arm-gnueabi-g++ -optimized-qmake -c++std c++11 --rpath=no -pch -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtlocation -skip qtmacextras -skip qtnetworkauth -skip qtpurchasing -skip qtremoteobjects -skip qtscript -skip qtscxml -skip qtsensors -skip qtspeech -skip qtsvg -skip qttools -skip qttranslations -skip qtwayland -skip qtwebengine -skip qtwebview -skip qtwinextras -skip qtx11extras -skip qtxmlpatterns -make libs -make examples -nomake tools -nomake tests -gui -widgets -dbus-runtime --glib=no --iconv=no --pcre=qt --zlib=qt -no-openssl --freetype=qt --harfbuzz=qt -no-opengl -linuxfb --xcb=no -tslib --libpng=qt --libjpeg=qt --sqlite=qt -plugin-sql-sqlite -I/opt/tslib/include -L/opt/tslib/lib -recheck-all executing config test machineTuple + arm-linux-gnueabi-g++ -dumpmachine > sh: 1: arm-linux-gnueabi-g++: not found test config.qtbase.tests.machineTuple FAILED executing config test verifyspec + cd /home/liuyh/workspace/QT5.14.2/qt-everywhere-src-5.14.2/config.tests/verifyspec && /home/liuyh/workspace/QT5.14.2/qt-everywhere-src-5.14.2/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" 'QMAKE_LIBDIR += /opt/tslib/lib' 'INCLUDEPATH += /opt/tslib/include' -early "CONFIG += cross_compile" /home/liuyh/workspace/QT5.14.2/qt-everywhere-src-5.14.2/qtbase/config.tests/verifyspec + cd /home/liuyh/workspace/QT5.14.2/qt-everywhere-src-5.14.2/config.tests/verifyspec && MAKEFLAGS= /usr/bin/make clean && MAKEFLAGS= /usr/bin/make > rm -f verifyspec.o > rm -f *~ core *.core > arm-linux-gnueabi-g++ -c -O2 -march=armv7-a -mtune=cortex-a7 -mfpu=neon -mfloat-abi=hard -O2 -march=armv7-a -mtune=cortex-a7 -mfpu=neon -mfloat-abi=hard -pipe -O2 -w -fPIC -I/home/liuyh/workspace/QT5.14.2/qt-everywhere-src-5.14.2/qtbase/config.tests/verifyspec -I. -I/opt/tslib/include -I/home/liuyh/workspace/QT5.14.2/qt-everywhere-src-5.14.2/qtbase/mkspecs/linux-arm-gnueabi-g++ -o verifyspec.o /home/liuyh/workspace/QT5.14.2/qt-everywhere-src-5.14.2/qtbase/config.tests/verifyspec/verifyspec.cpp > make:arm-linux-gnueabi-g++:命令未找到 > make: *** [Makefile:172:verifyspec.o] 错误 127

最新推荐

recommend-type

Android WebView支持input file启用相机/选取照片功能

主要介绍了Android-WebView支持input file启用相机/选取照片功能,本文通过实例代码给大家介绍的非常详细,具有一定的参考借鉴价值,需要的朋友可以参考下
recommend-type

webview添加参数与修改请求头的user-agent实例

主要介绍了webview添加参数与修改请求头的user-agent实例,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
recommend-type

uniapp与webview之间的相互传值的实现

主要介绍了uniapp与webview之间的相互传值的实现,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
recommend-type

Android 解决WebView无法上传文件的问题

主要介绍了Android 解决WebView无法上传文件的问题的相关资料,需要的朋友可以参考下
recommend-type

Android实现WebView删除缓存的方法

主要介绍了Android实现WebView删除缓存的方法,实例分析了Android针对WebView操作缓存的相关技巧,具有一定参考借鉴价值,需要的朋友可以参考下
recommend-type

zigbee-cluster-library-specification

最新的zigbee-cluster-library-specification说明文档。
recommend-type

管理建模和仿真的文件

管理Boualem Benatallah引用此版本:布阿利姆·贝纳塔拉。管理建模和仿真。约瑟夫-傅立叶大学-格勒诺布尔第一大学,1996年。法语。NNT:电话:00345357HAL ID:电话:00345357https://theses.hal.science/tel-003453572008年12月9日提交HAL是一个多学科的开放存取档案馆,用于存放和传播科学研究论文,无论它们是否被公开。论文可以来自法国或国外的教学和研究机构,也可以来自公共或私人研究中心。L’archive ouverte pluridisciplinaire
recommend-type

实现实时数据湖架构:Kafka与Hive集成

![实现实时数据湖架构:Kafka与Hive集成](https://img-blog.csdnimg.cn/img_convert/10eb2e6972b3b6086286fc64c0b3ee41.jpeg) # 1. 实时数据湖架构概述** 实时数据湖是一种现代数据管理架构,它允许企业以低延迟的方式收集、存储和处理大量数据。与传统数据仓库不同,实时数据湖不依赖于预先定义的模式,而是采用灵活的架构,可以处理各种数据类型和格式。这种架构为企业提供了以下优势: - **实时洞察:**实时数据湖允许企业访问最新的数据,从而做出更明智的决策。 - **数据民主化:**实时数据湖使各种利益相关者都可
recommend-type

用 Python 画一个可以动的爱心

好的,我可以帮助您使用Python来绘制一个动态的爱心。您可以使用turtle库来实现。以下是实现代码: ```python import turtle import math # 设置画布和画笔 canvas = turtle.Screen() canvas.bgcolor("black") pencil = turtle.Turtle() pencil.speed(0) pencil.color("red", "pink") pencil.pensize(3) # 定义爱心函数 def draw_love(heart_size, x_offset=0, y_offset=0):
recommend-type

JSBSim Reference Manual

JSBSim参考手册,其中包含JSBSim简介,JSBSim配置文件xml的编写语法,编程手册以及一些应用实例等。其中有部分内容还没有写完,估计有生之年很难看到完整版了,但是内容还是很有参考价值的。