mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-11 09:59:59 +08:00
🐛 Fix(custom): fix aws s3 urlprefix bug
This commit is contained in:
@@ -134,12 +134,23 @@ export async function removeFileFromS3InMain (configMap: IStringKeyMap, dogeMode
|
||||
sessionToken: configMap.config.sessionToken
|
||||
}
|
||||
}
|
||||
const client = new S3Client(s3Options)
|
||||
const command = new DeleteObjectCommand({
|
||||
Bucket: bucketName,
|
||||
Key: fileKey
|
||||
})
|
||||
const result = await client.send(command)
|
||||
let result: any
|
||||
try {
|
||||
const client = new S3Client(s3Options)
|
||||
const command = new DeleteObjectCommand({
|
||||
Bucket: bucketName,
|
||||
Key: fileKey
|
||||
})
|
||||
result = await client.send(command)
|
||||
} catch (err: any) {
|
||||
s3Options.region = 'us-east-1'
|
||||
const client = new S3Client(s3Options)
|
||||
const command = new DeleteObjectCommand({
|
||||
Bucket: bucketName,
|
||||
Key: fileKey
|
||||
})
|
||||
result = await client.send(command)
|
||||
}
|
||||
return result.$metadata.httpStatusCode === 204
|
||||
} catch (err: any) {
|
||||
console.log(err)
|
||||
|
||||
@@ -2832,9 +2832,8 @@ async function getBucketFileListBackStage () {
|
||||
isLoadingData.value = true
|
||||
const fileTransferStore = useFileTransferStore()
|
||||
fileTransferStore.resetFileTransferList()
|
||||
if (currentPicBedName.value === 'webdavplist' ||
|
||||
currentPicBedName.value === 'local' ||
|
||||
currentPicBedName.value === 'sftp') {
|
||||
const picBedNamesArr = ['webdavplist', 'local', 'sftp']
|
||||
if (picBedNamesArr.includes(currentPicBedName.value)) {
|
||||
param.baseDir = configMap.baseDir
|
||||
param.webPath = configMap.webPath
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user