From 890076a7416513c867f1f2aef7c9929aa899894e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=B8=80=E4=B9=8B?= Date: Fri, 25 Aug 2023 14:09:11 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E5=BF=BD=E7=95=A5webdav?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=9B=AE=E5=BD=95=E9=94=99=E8=AF=AF=20#213?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/filesystem/webdav/webdav.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pkg/filesystem/webdav/webdav.ts b/pkg/filesystem/webdav/webdav.ts index 29b69009..e61012aa 100644 --- a/pkg/filesystem/webdav/webdav.ts +++ b/pkg/filesystem/webdav/webdav.ts @@ -61,8 +61,18 @@ export default class WebDAVFileSystem implements FileSystem { ); } - createDir(path: string): Promise { - return this.client.createDirectory(joinPath(this.basePath, path)); + async createDir(path: string): Promise { + try { + return Promise.resolve( + await this.client.createDirectory(joinPath(this.basePath, path)) + ); + } catch (e: any) { + // 如果是405错误,则忽略 + if (e.message.includes("405")) { + return Promise.resolve(); + } + return Promise.reject(e); + } } async delete(path: string): Promise {