This commit is contained in:
eric
2026-03-27 19:35:39 -05:00
parent e1ed5a56dc
commit b099437738
7 changed files with 125 additions and 5 deletions

12
app/https-upgrade.ts Normal file
View File

@@ -0,0 +1,12 @@
/**
* 微信等环境可能以 http 打开 vip 域名,导致 Cookie/支付与 https 不一致。
* 在任意 JS 执行前立即跳转到 httpsmiddleware 之外的兜底)。
*/
export const httpsUpgradeScript = `
(function(){
var h=location.hostname;
if(h!=="vip.hackrobot.cn"&&h!=="www.vip.hackrobot.cn")return;
if(location.protocol!=="http:")return;
location.replace("https://"+h+location.pathname+location.search+location.hash);
})();
`;