🐛 Fix(custom): fix webdav sync issues

ISSUES CLOSED: #383
This commit is contained in:
Kuingsmile
2025-09-05 11:40:43 +08:00
parent ec878b2952
commit 0fac1119a0

View File

@@ -379,8 +379,10 @@ async function downloadRemoteToLocal(syncConfig: ISyncConfig, fileName: string)
if (webdavAuthType === 'digest') { if (webdavAuthType === 'digest') {
options.authType = AuthType.Digest options.authType = AuthType.Digest
} }
console.log(webdavEndpointF, options)
const client = createClient(webdavEndpointF, options) const client = createClient(webdavEndpointF, options)
const remoteFilePath = webdavSavePath ? path.join(webdavSavePath, fileName) : fileName const remoteFilePath = (webdavSavePath ? path.join(webdavSavePath, fileName) : fileName).replace(/\\/g, '/')
console.log('remoteFilePath', remoteFilePath)
const fileContent = await client.getFileContents(remoteFilePath) const fileContent = await client.getFileContents(remoteFilePath)
await fs.writeFile(localFilePath, fileContent as Buffer) await fs.writeFile(localFilePath, fileContent as Buffer)
return true return true