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"
    }
相关推荐
aaaameliaaa1 小时前
字符函数和字符串函数
c语言·笔记·算法
tq10862 小时前
开放与封闭:类型系统的安全哲学
笔记
龙仔7253 小时前
人大金仓 KingbaseES V8 只读账号创建完整运维笔记
运维·笔记·sql·人大金仓
韭菜炒鸡肝天3 小时前
VTK开发笔记(一):VTK介绍,Qt..+VSx+VTK.编译
开发语言·笔记·qt
峥无6 小时前
C++11 深度详解:现代 C++ 基石全梳理
开发语言·c++·笔记
阿米亚波6 小时前
【C++ STL】std::unordered_multimap
开发语言·数据结构·c++·笔记·stl
早睡早起身体好1238 小时前
为什么 Network 中会出现两个同名请求?——CORS 预检请求学习笔记
网络·笔记·学习·网络安全
@Mike@9 小时前
06-数据库学习笔记(存储模型与数据压缩)
数据库·笔记·学习
不在逃避q10 小时前
Golang笔记之Redis
redis·笔记·golang
wdfk_prog10 小时前
嵌入式面试真题学习笔记系列
笔记·学习·面试