uniapp小程序https页面嵌套http的H5页面问题笔记

一、错误信息

复制代码
This request has been blocked; the content must be served over HTTPS.

二、解决方法

html 复制代码
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

三、解决过程

1、在根目录下新建template.html

html 复制代码
<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
		<title>
			<%= htmlWebpackPlugin.options.title %>
		</title>
		<!-- Open Graph data -->
		<!-- <meta property="og:title" content="Title Here" /> -->
		<!-- <meta property="og:url" content="http://www.example.com/" /> -->
		<!-- <meta property="og:image" content="http://example.com/image.jpg" /> -->
		<!-- <meta property="og:description" content="Description Here" /> -->
		<script>
			var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
			document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')
		</script>
		<link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
	</head>
	<body>
		<noscript>
			<strong>Please enable JavaScript to continue.</strong>
		</noscript>
		<div id="app"></div>
		<!-- built files will be auto injected -->
	</body>
</html>

2、在manifest.json中配置

javascript 复制代码
"h5" : {
        "router" : {
            "mode" : "hash",
            "base" : "/jidian/."
        },
        "title" : "自助祭奠",
        "template" : "template.html"
    }
相关推荐
密码小丑22 分钟前
玄机-apache日志分析
网络·笔记·apache
XYN6128 分钟前
【嵌入式面试】
笔记·python·单片机·嵌入式硬件·学习
s_yellowfish2 小时前
Maven笔记
java·笔记·maven
放羊大亨3 小时前
《认知觉醒》下篇·第六章第一节“清晰:一个观念,重构你的行动力” 总结
笔记
小白探索世界欧耶!~4 小时前
【踩坑】GitHub Actions 运行的 Linux 环境中,文件名是大小写敏感的
linux·运维·服务器·前端·vue.js·笔记·github
0x4084 小时前
数据结构--线性表&顺序表示(上)
数据结构·笔记
Tanner_SL5 小时前
Linux笔记之Ubuntu系统设置自动登录tty1界面
linux·笔记·ubuntu
愚润求学5 小时前
【C++】模板进阶
c语言·开发语言·c++·笔记·模板
东方芷兰5 小时前
JavaWeb 课堂笔记 —— 03 Vue
java·前端·javascript·vue.js·笔记
DXM05216 小时前
牟乃夏《ArcGIS Engine地理信息系统开发教程》学习笔记1
开发语言·经验分享·笔记·学习·arcgis·c#·arcgis engine