Mount /vip with nomadvip+payjsapi, add @nomadro/pay|pb|sdk, apps/api, /admin shell, and backup/rollback scripts under git.nomadro.cn workflow. Co-authored-by: Cursor <cursoragent@cursor.com>
13 lines
458 B
TypeScript
13 lines
458 B
TypeScript
/**
|
||
* 微信等环境可能以 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);
|
||
})();
|
||
`;
|