From a3b9cc14f22c0ec038ddb9f65065b200e7bba159 Mon Sep 17 00:00:00 2001 From: VirtualHotBar <96966978+VirtualHotBar@users.noreply.github.com> Date: Fri, 17 May 2024 14:18:40 +0800 Subject: [PATCH] Update add.tsx --- src/page/mount/add.tsx | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/page/mount/add.tsx b/src/page/mount/add.tsx index 79af8d1..0262f61 100644 --- a/src/page/mount/add.tsx +++ b/src/page/mount/add.tsx @@ -38,6 +38,7 @@ export default function AddMount_page() { const isMountPathCustom = mountPath !== '*' && !mountPath.startsWith('~/Desktop/'); const mountPathuIsDriveLetter = isWindows && (mountPath === '*' || mountPath.endsWith(':') || mountPath.endsWith(':/')); + console.log(mountPath); const checkWinFspState = async () => { @@ -67,9 +68,9 @@ export default function AddMount_page() { useEffect(() => { setMountPath(mountPath.replace(/\\/g, '/').replace(/\/+/g, '/')) - /* if (mountPathuIsDriveLetter) { - mountOptFormHook && mountOptFormHook.setFieldsValue({ VolumeName: storageName }) - } */ + /* if (mountPathuIsDriveLetter) { + mountOptFormHook && mountOptFormHook.setFieldsValue({ VolumeName: storageName }) + } */ }, [mountPath]) useEffect(() => { @@ -95,21 +96,24 @@ export default function AddMount_page() { }, []) useEffect(() => { - //默认挂载路径 - if (isWindows) { - //setMountPath('*') - setMountPath('~/Desktop/' + storageName) + if (!isEditMode) { + //默认挂载路径 + if (isWindows) { + //setMountPath('*') + setMountPath('~/Desktop/' + storageName) - } else { - if (storageName) { - if (rcloneInfo.version.os.toLowerCase().includes('darwin')) { - setMountPath('~/Desktop/' + storageName) - } else { - setMountPath('/mnt/' + storageName) + } else { + if (storageName) { + if (rcloneInfo.version.os.toLowerCase().includes('darwin')) { + setMountPath('~/Desktop/' + storageName) + } else { + setMountPath('/mnt/' + storageName) + } } } } + }, [storageName]) useEffect(() => {