From c87739768224c4325c6061e335d631425fdab972 Mon Sep 17 00:00:00 2001 From: mtvpls Date: Sun, 26 Apr 2026 17:41:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E4=BA=91=E7=9B=98=E5=9C=A8?= =?UTF-8?q?=E7=BA=BF=E6=92=AD=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/admin/page.tsx | 95 +++++ src/app/api/admin/netdisk/route.ts | 26 +- .../api/netdisk/mobile/instant-play/route.ts | 55 +++ src/app/api/netdisk/mobile/play/route.ts | 90 +++++ .../api/netdisk/quark/instant-play/route.ts | 3 +- src/app/api/source-detail/route.ts | 85 ++++- src/app/play/page.tsx | 96 ++--- src/app/search/page.tsx | 86 +++-- src/components/EpisodeSelector.tsx | 3 +- src/components/PansouSearch.tsx | 33 +- src/components/VideoCard.tsx | 35 +- src/lib/admin.types.ts | 4 + src/lib/config.ts | 11 + src/lib/netdisk/mobile-session-cache.ts | 105 ++++++ src/lib/netdisk/mobile.client.ts | 330 ++++++++++++++++++ src/lib/netdisk/source.ts | 31 ++ 16 files changed, 984 insertions(+), 104 deletions(-) create mode 100644 src/app/api/netdisk/mobile/instant-play/route.ts create mode 100644 src/app/api/netdisk/mobile/play/route.ts create mode 100644 src/lib/netdisk/mobile-session-cache.ts create mode 100644 src/lib/netdisk/mobile.client.ts create mode 100644 src/lib/netdisk/source.ts diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx index ac407c3..9424738 100644 --- a/src/app/admin/page.tsx +++ b/src/app/admin/page.tsx @@ -3706,14 +3706,19 @@ const NetDiskConfigComponent = ({ const [savePath, setSavePath] = useState('/'); const [playTempSavePath, setPlayTempSavePath] = useState('/'); const [openListTempPath, setOpenListTempPath] = useState('/'); + const [mobileEnabled, setMobileEnabled] = useState(false); + const [mobileAuthorization, setMobileAuthorization] = useState(''); useEffect(() => { const quark = config?.NetDiskConfig?.Quark; + const mobile = config?.NetDiskConfig?.Mobile; setEnabled(quark?.Enabled || false); setCookie(quark?.Cookie || ''); setSavePath(quark?.SavePath || '/'); setPlayTempSavePath(quark?.PlayTempSavePath || '/'); setOpenListTempPath(quark?.OpenListTempPath || '/'); + setMobileEnabled(mobile?.Enabled || false); + setMobileAuthorization(mobile?.Authorization || ''); }, [config]); const handleSave = async () => { @@ -3730,6 +3735,10 @@ const NetDiskConfigComponent = ({ PlayTempSavePath: playTempSavePath, OpenListTempPath: openListTempPath, }, + Mobile: { + Enabled: mobileEnabled, + Authorization: mobileAuthorization, + }, }), }); @@ -3772,6 +3781,34 @@ const NetDiskConfigComponent = ({ }); }; + const handleValidateMobile = async () => { + await withLoading('validateMobileNetDisk', async () => { + try { + const response = await fetch('/api/admin/netdisk', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + action: 'validate', + provider: 'mobile', + Mobile: { + Authorization: mobileAuthorization, + }, + }), + }); + + const data = await response.json(); + if (!response.ok) { + throw new Error(data.error || '校验失败'); + } + + showSuccess(data.message || '移动云盘验证头格式正常', showAlert); + } catch (error) { + showError(error instanceof Error ? error.message : '校验失败', showAlert); + throw error; + } + }); + }; + return (
@@ -3891,6 +3928,64 @@ const NetDiskConfigComponent = ({
+
+ + 移动云盘 + +
+
+
+

+ 启用移动云盘 +

+

+ 开启后,网盘搜索中的移动云盘资源会显示“立即播放”按钮 +

+
+ +
+ +
+ +