🐛 Fix(custom): fix file delete bug

This commit is contained in:
Kuingsmile 2024-12-17 16:11:45 +08:00
parent 3efd2c2dd1
commit e2e802b30f

View File

@ -141,7 +141,7 @@ class Uploader {
logger.error(e)
return false
} finally {
if (imgPath) {
if (imgPath && imgPath.startsWith(path.join(picgo.baseDir, CLIPBOARD_IMAGE_FOLDER))) {
fs.remove(imgPath)
}
}
@ -157,7 +157,7 @@ class Uploader {
logger.error(e)
return false
} finally {
if (imgPath) {
if (imgPath && imgPath.startsWith(path.join(picgo.baseDir, CLIPBOARD_IMAGE_FOLDER))) {
fs.remove(imgPath)
}
}