Spaces:
Running
Running
Update egg-api.js
Browse files- egg-api.js +3 -3
egg-api.js
CHANGED
|
@@ -168,7 +168,7 @@ app.get('/process-image', async (req, res) => {
|
|
| 168 |
} else {
|
| 169 |
// 删除临时文件
|
| 170 |
fs.unlinkSync(tempImagePath);
|
| 171 |
-
if (tempImagePaths) {
|
| 172 |
fs.unlinkSync(tempImagePaths);
|
| 173 |
}
|
| 174 |
fs.unlinkSync(outputImagePath);
|
|
@@ -291,8 +291,8 @@ app.get('/processGif', async (req, res) => {
|
|
| 291 |
} else {
|
| 292 |
// 删除临时文件
|
| 293 |
fs.unlinkSync(tempGifPath);
|
| 294 |
-
if(tempGifPaths){
|
| 295 |
-
|
| 296 |
}
|
| 297 |
fs.unlinkSync(tempVideoPath);
|
| 298 |
fs.unlinkSync(outputGifPath);
|
|
|
|
| 168 |
} else {
|
| 169 |
// 删除临时文件
|
| 170 |
fs.unlinkSync(tempImagePath);
|
| 171 |
+
if (fs.existsSync(tempImagePaths)) {
|
| 172 |
fs.unlinkSync(tempImagePaths);
|
| 173 |
}
|
| 174 |
fs.unlinkSync(outputImagePath);
|
|
|
|
| 291 |
} else {
|
| 292 |
// 删除临时文件
|
| 293 |
fs.unlinkSync(tempGifPath);
|
| 294 |
+
if (fs.existsSync(tempGifPaths)) {
|
| 295 |
+
fs.unlinkSync(tempGifPaths);
|
| 296 |
}
|
| 297 |
fs.unlinkSync(tempVideoPath);
|
| 298 |
fs.unlinkSync(outputGifPath);
|