's'
This commit is contained in:
12
app/https-upgrade.ts
Normal file
12
app/https-upgrade.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* 微信等环境可能以 http 打开 vip 域名,导致 Cookie/支付与 https 不一致。
|
||||
* 在任意 JS 执行前立即跳转到 https(middleware 之外的兜底)。
|
||||
*/
|
||||
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);
|
||||
})();
|
||||
`;
|
||||
Reference in New Issue
Block a user