(url: string, options: WebDAVClientOptions)
| 31 | basePath: string = "/"; |
| 32 | |
| 33 | static fromCredentials(url: string, options: WebDAVClientOptions) { |
| 34 | initWebDAVPatch(); |
| 35 | options = { |
| 36 | ...options, |
| 37 | headers: { |
| 38 | "X-Requested-With": "XMLHttpRequest", // Nextcloud 等需要 |
| 39 | // "requesttoken": csrfToken, // 按账号各自传入 |
| 40 | }, |
| 41 | }; |
| 42 | return new WebDAVFileSystem(createClient(url, options), url, "/"); |
| 43 | } |
| 44 | |
| 45 | static fromSameClient(fs: WebDAVFileSystem, basePath: string) { |
| 46 | return new WebDAVFileSystem(fs.client, fs.url, basePath); |