feat: 首访自动跳转 IPv4/IPv6 线路选择页 (v-fixed97)
Docker Build & Test / build (push) Canceled after 0s
Docker Build & Test / test (push) Canceled after 0s
Build & Push Docker image / build-and-push (linux/amd64) (push) Canceled after 0s
Build & Push Docker image / build-and-push (linux/arm/v7) (push) Canceled after 0s
Build & Push Docker image / build-and-push (linux/arm64) (push) Canceled after 0s
Build & Push Docker image / merge-images (push) Canceled after 0s
Release / release (push) Canceled after 0s
Release / docker (push) Canceled after 0s
Docker Build & Test / build (push) Canceled after 0s
Docker Build & Test / test (push) Canceled after 0s
Build & Push Docker image / build-and-push (linux/amd64) (push) Canceled after 0s
Build & Push Docker image / build-and-push (linux/arm/v7) (push) Canceled after 0s
Build & Push Docker image / build-and-push (linux/arm64) (push) Canceled after 0s
Build & Push Docker image / merge-images (push) Canceled after 0s
Release / release (push) Canceled after 0s
Release / docker (push) Canceled after 0s
This commit is contained in:
1 parent
e34ec79d5a
commit
9ffb113ca5
5 files changed
+61
-4
No files matched your search
@@ -9,6 +9,7 @@ export default function Ipv6Button({ forceShow = false, compact = false, light =
|
||||
return (
|
||||
<button
|
||||
onClick={() => {
|
||||
try { sessionStorage.setItem('__v6back', location.pathname + location.search + location.hash); } catch {}
|
||||
location.href = '/ipv6';
|
||||
}}
|
||||
title='切换 IPv4 / IPv6 线路'
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
'use client';
|
||||
|
||||
// 首次访问公网入口时跳转到 /ipv6 线路选择页(源码化恢复:旧版 patch_license.js V6-PROBE 在迁移时未搬入源码)
|
||||
import { useEffect } from 'react';
|
||||
|
||||
export default function Ipv6FirstVisitGate() {
|
||||
useEffect(() => {
|
||||
try {
|
||||
if (location.hostname !== 'tv.88531.cn') return; // 仅公网 IPv4 入口;LAN/IPv6 线路不跳转(避免循环)
|
||||
if (location.pathname === '/ipv6') return;
|
||||
if (localStorage.getItem('__v6dest')) return; // 已记住线路,不打扰
|
||||
sessionStorage.setItem('__v6back', location.pathname + location.search + location.hash);
|
||||
location.replace('/ipv6');
|
||||
} catch {}
|
||||
}, []);
|
||||
return null;
|
||||
}
|
||||
Reference in new issue
Block a user