Переглянути джерело

修改后台接口决策事项,文件上传路径问题

hyx 2 роки тому
батько
коміт
35c01a8352

+ 14 - 14
nngkxxdp/src/main/java/com/example/nngkxxdp/service/impl/PostManagementServiceImpl.java

@@ -199,7 +199,7 @@ public class PostManagementServiceImpl implements PostManagementService {
             } else {
                 if (stringList != null && stringList.size() > 0) {
                     for (String url : stringList) {
-                        File file = new File(filePath + "\\" + url);
+                        File file = new File(filePath + url);
                         file.delete();
                     }
                 }
@@ -214,7 +214,7 @@ public class PostManagementServiceImpl implements PostManagementService {
             } else {
                 if (stringList != null && stringList.size() > 0) {
                     for (String url : stringList) {
-                        File file = new File(filePath + "\\" + url);
+                        File file = new File(filePath + url);
                         file.delete();
                     }
                 }
@@ -229,7 +229,7 @@ public class PostManagementServiceImpl implements PostManagementService {
             } else {
                 if (stringList != null && stringList.size() > 0) {
                     for (String url : stringList) {
-                        File file = new File(filePath + "\\" + url);
+                        File file = new File(filePath + url);
                         file.delete();
                     }
                 }
@@ -244,7 +244,7 @@ public class PostManagementServiceImpl implements PostManagementService {
             } else {
                 if (stringList != null && stringList.size() > 0) {
                     for (String url : stringList) {
-                        File file = new File(filePath + "\\" + url);
+                        File file = new File(filePath + url);
                         file.delete();
                     }
                 }
@@ -254,7 +254,7 @@ public class PostManagementServiceImpl implements PostManagementService {
         if (postManagementDao.savePost(postManagement) <= 0) {
             if (stringList != null && stringList.size() > 0) {
                 for (String url : stringList) {
-                    File file = new File(filePath + "\\" + url);
+                    File file = new File(filePath + url);
                     file.delete();
                 }
             }
@@ -307,7 +307,7 @@ public class PostManagementServiceImpl implements PostManagementService {
             } else {
                 if (stringList != null && stringList.size() > 0) {
                     for (String url : stringList) {
-                        File file = new File(filePath + "\\" + url);
+                        File file = new File(filePath + url);
                         file.delete();
                     }
                 }
@@ -330,7 +330,7 @@ public class PostManagementServiceImpl implements PostManagementService {
             } else {
                 if (stringList != null && stringList.size() > 0) {
                     for (String url : stringList) {
-                        File file = new File(filePath + "\\" + url);
+                        File file = new File(filePath + url);
                         file.delete();
                     }
                 }
@@ -353,7 +353,7 @@ public class PostManagementServiceImpl implements PostManagementService {
             } else {
                 if (stringList != null && stringList.size() > 0) {
                     for (String url : stringList) {
-                        File file = new File(filePath + "\\" + url);
+                        File file = new File(filePath + url);
                         file.delete();
                     }
                 }
@@ -376,7 +376,7 @@ public class PostManagementServiceImpl implements PostManagementService {
             } else {
                 if (stringList != null && stringList.size() > 0) {
                     for (String url : stringList) {
-                        File file = new File(filePath + "\\" + url);
+                        File file = new File(filePath + url);
                         file.delete();
                     }
                 }
@@ -391,7 +391,7 @@ public class PostManagementServiceImpl implements PostManagementService {
         if (postManagementDao.updatePostById(postManagement) <= 0) {
             if (stringList != null && stringList.size() > 0) {
                 for (String url : stringList) {
-                    File file = new File(filePath + "\\" + url);
+                    File file = new File(filePath + url);
                     file.delete();
                 }
             }
@@ -399,7 +399,7 @@ public class PostManagementServiceImpl implements PostManagementService {
         }
         if (oldStringList != null && oldStringList.size() > 0) {
             for (String url : oldStringList) {
-                File file = new File(filePath + "\\" + url);
+                File file = new File(filePath + url);
                 file.delete();
             }
         }
@@ -471,14 +471,14 @@ public class PostManagementServiceImpl implements PostManagementService {
         }
         // 原文件名
         String originalFileName = file.getOriginalFilename();
-        File oldFile = new File(fileDir + "\\pdf" + "\\" + originalFileName);
+        File oldFile = new File(fileDir + "pdf" + "/" + originalFileName);
         file.transferTo(oldFile);
         //FileTypeUtil.getType要在磁盘中有这个文件才能执行
         String type = FileTypeUtil.getType(oldFile);
         //新文件名
         String newFileName = generTrfn() + "." + type;
         //创建file对象
-        File temporaryFile = new File(fileDir + "\\pdf" + "\\" + newFileName);
+        File temporaryFile = new File(fileDir + "pdf" + "/" + newFileName);
         if (temporaryFile.exists()) {
             map.put("result", false);
             map.put("msg", "此文件已经存在");
@@ -492,7 +492,7 @@ public class PostManagementServiceImpl implements PostManagementService {
             return map;
         }
         map.put("result", true);
-        map.put("data", "\\pdf" + "\\" + newFileName);
+        map.put("data", "pdf" + "/" + newFileName);
         map.put("msg", "上传成功");
         return map;
     }

+ 2 - 2
nngkxxdp/src/main/resources/static/naqwzsjtj/naqwzsjtj/vue.config.js

@@ -7,9 +7,9 @@ module.exports = {
         open: true,
         proxy: {
             '/': {
-                // target:'http://192.168.0.230:7777/',//开发
+                target:'http://192.168.0.230:7777/',//开发
                 // target:'http://192.168.0.7:7777/',//开发
-                target:'http://192.168.1.253:7777/',//测试
+                // target:'http://192.168.1.253:7777/',//测试
                 // target:'http://data.cqna.gov.cn/',//线上
                 changeOrigin: true,
                 pathRewrite: {