mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-15 04:18:02 +08:00
🐛 Fix(custom): fix s3 remote delete bug when url is modified locally
This commit is contained in:
@@ -73,8 +73,11 @@ async function getDogeToken (accessKey: string, secretKey: string): Promise<{} |
|
||||
|
||||
export async function removeFileFromS3InMain (configMap: IStringKeyMap, dogeMode: boolean = false) {
|
||||
try {
|
||||
const { imgUrl, config: { accessKeyID, secretAccessKey, bucketName, endpoint, pathStyleAccess, rejectUnauthorized, proxy } } = configMap
|
||||
let { config: { region } } = configMap
|
||||
const { url: rawUrl, type, config: { accessKeyID, secretAccessKey, bucketName, endpoint, pathStyleAccess, rejectUnauthorized, proxy } } = configMap
|
||||
let { imgUrl, config: { region } } = configMap
|
||||
if (type === 'aws-s3' || type === 'aws-s3-plist') {
|
||||
imgUrl = rawUrl || imgUrl || ''
|
||||
}
|
||||
const url = new URL(!/^https?:\/\//.test(imgUrl) ? `http://${imgUrl}` : imgUrl)
|
||||
let fileKey = url.pathname.replace(/^\/+/, '')
|
||||
if (pathStyleAccess) {
|
||||
|
||||
Reference in New Issue
Block a user