From 046f2c06d01c2d0fe551e717c14a72497c29be27 Mon Sep 17 00:00:00 2001 From: fei1025 <46546005+fei1025@users.noreply.github.com> Date: Thu, 14 Nov 2024 14:42:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B7=AF=E5=BE=84=E5=9C=A8wi?= =?UTF-8?q?ndos=E4=B8=8B=E8=AF=BB=E5=8F=96=E4=B8=8D=E5=88=B0=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(#630)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 修复路径在windos下读取不到的问题 * opt: `local.dart` fmt --------- Co-authored-by: Noo6 <72285529+No06@users.noreply.github.com> --- lib/view/page/storage/local.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/view/page/storage/local.dart b/lib/view/page/storage/local.dart index 729d4639..3e0d3293 100644 --- a/lib/view/page/storage/local.dart +++ b/lib/view/page/storage/local.dart @@ -65,6 +65,10 @@ class _LocalFilePageState extends State final path = await Pfs.pickFilePath(); if (path == null) return; final name = path.getFileName() ?? 'imported'; + final destinationDir = Directory(_path.path); + if (!await destinationDir.exists()) { + await destinationDir.create(recursive: true); + } await File(path).copy(_path.path.joinPath(name)); setState(() {}); },