Files
hzdyjs/mobile/public/index.html
T
2025-08-08 20:35:17 +08:00

83 lines
3.2 KiB
HTML

<!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>
<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"
/>
<!-- 微信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>
</head>
<body>
<noscript>
<strong>Please enable JavaScript to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>