소스 검색

图片地址切换

anderx 3 년 전
부모
커밋
e705a00dfb
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      src/main/java/com/goafanti/common/controller/TestPublicController.java

+ 4 - 2
src/main/java/com/goafanti/common/controller/TestPublicController.java

@@ -187,8 +187,10 @@ public class TestPublicController extends CertifyApiController {
         createFile(targetFile);
         //复制文件
         copyFile(srcFile,destFile);
-        //删除源文件
-        srcFile.delete();
+        //新地址有则删除旧数据删除源文件
+        if (destFile.exists()){
+            srcFile.delete();
+        }
         return 1;
     }