mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-27 03:00:25 +08:00
🐛 Fix(custom): fix webdav image preview issue
This commit is contained in:
@@ -194,9 +194,6 @@ try {
|
||||
mime: {
|
||||
lookup: mime.getType.bind(mime),
|
||||
},
|
||||
buffer: {
|
||||
from: Buffer.from,
|
||||
},
|
||||
})
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
|
||||
@@ -61,8 +61,7 @@ async function getWebdavHeader(key: string) {
|
||||
}
|
||||
} else {
|
||||
headers = {
|
||||
Authorization:
|
||||
'Basic ' + window.node.buffer.from(`${props.config.username}:${props.config.password}`).toString('base64'),
|
||||
Authorization: 'Basic ' + btoa(`${props.config.username}:${props.config.password}`),
|
||||
}
|
||||
}
|
||||
return headers
|
||||
|
||||
@@ -1820,7 +1820,7 @@ async function handleClickFile(item: any) {
|
||||
const options = {} as any
|
||||
if (currentPicBedName.value === 'webdavplist') {
|
||||
options.headers = {
|
||||
Authorization: `Basic ${window.node.buffer.from(`${manageStore.config.picBed[configMap.value.alias].username}:${manageStore.config.picBed[configMap.value.alias].password}`).toString('base64')}`,
|
||||
Authorization: `Basic ${btoa(`${manageStore.config.picBed[configMap.value.alias].username}:${manageStore.config.picBed[configMap.value.alias].password}`)}`,
|
||||
}
|
||||
}
|
||||
if (item.isImage) {
|
||||
|
||||
3
src/universal/types/shims-tsx.d.ts
vendored
3
src/universal/types/shims-tsx.d.ts
vendored
@@ -59,9 +59,6 @@ declare global {
|
||||
mime: {
|
||||
lookup: typeof mime.getType
|
||||
}
|
||||
buffer: {
|
||||
from: typeof Buffer.from
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user