소스 검색

feat:delImage

ananzhusen 1 년 전
부모
커밋
c40da293eb
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/services/api.ts

+ 1 - 1
src/services/api.ts

@@ -9,7 +9,7 @@ export const upCdn = isProd ? 'https://drive.le5lecdn.com' : '';
 const imageDrive = 'https://drive.le5lecdn.com';
 //https://v.le5le.com/file/2023/0828/1/1/thumb.07c0a78f.png
 export async function delImage(image: string) {
-  if (image.startsWith('/file')) {
+  if (image.startsWith('/file') || image.startsWith('/api')) {
     await axios.delete(`${image}`);
   } else if (image.startsWith(upCdn) || image.startsWith(imageDrive)) {
     await axios.delete('/file' + image.replace(upCdn || imageDrive, ''));