提交代码
This commit is contained in:
1 parent
30042caabb
commit
600f0c621c
108 files changed
+20109
-1605
No files matched your search
+68
-11
@@ -1,17 +1,75 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>
|
||||
<%= htmlWebpackPlugin.options.title %>
|
||||
</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
<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' : '') + '" />')
|
||||
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"
|
||||
/>
|
||||
<!-- 微信JS-SDK -->
|
||||
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js" async></script>
|
||||
<script>
|
||||
// 微信JS-SDK备用加载逻辑 - 简化版 (2025-01-03)
|
||||
(function () {
|
||||
const cdnUrls = [
|
||||
'https://res.wx.qq.com/open/js/jweixin-1.6.0.js',
|
||||
'https://res2.wx.qq.com/open/js/jweixin-1.6.0.js',
|
||||
];
|
||||
let loadAttempts = 0;
|
||||
|
||||
function checkWxLoaded() {
|
||||
return (
|
||||
typeof wx !== 'undefined' &&
|
||||
wx.config &&
|
||||
typeof wx.config === 'function' &&
|
||||
wx.ready &&
|
||||
typeof wx.ready === 'function'
|
||||
);
|
||||
}
|
||||
|
||||
function loadBackupScript() {
|
||||
if (loadAttempts >= 2 || checkWxLoaded()) {
|
||||
return;
|
||||
}
|
||||
|
||||
loadAttempts++;
|
||||
console.log(`🔄 备用加载微信JS-SDK (${loadAttempts}/2)`);
|
||||
|
||||
const script = document.createElement('script');
|
||||
script.src = cdnUrls[loadAttempts % cdnUrls.length];
|
||||
script.async = true;
|
||||
script.onload = () => console.log('✅ 备用资源加载成功');
|
||||
script.onerror = () => {
|
||||
console.log('❌ 备用资源加载失败,重试...');
|
||||
setTimeout(loadBackupScript, 1000);
|
||||
};
|
||||
document.head.appendChild(script);
|
||||
}
|
||||
|
||||
// 延迟检查并启动备用加载
|
||||
setTimeout(() => {
|
||||
if (!checkWxLoaded()) {
|
||||
console.log('⚠️ 启动备用加载...');
|
||||
loadBackupScript();
|
||||
} else {
|
||||
console.log('✅ 微信JS-SDK主资源加载成功');
|
||||
}
|
||||
}, 2000);
|
||||
})();
|
||||
</script>
|
||||
<link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -21,5 +79,4 @@
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
Reference in new issue
Block a user