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 = ({
+
+ + 移动云盘 + +
+
+
+

+ 启用移动云盘 +

+

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

+
+ +
+ +
+ +