diff --git a/src/main/java/com/jingcheng/cms/controller/ArticleController.java b/src/main/java/com/jingcheng/cms/controller/ArticleController.java index aee5ce8..41430f9 100644 --- a/src/main/java/com/jingcheng/cms/controller/ArticleController.java +++ b/src/main/java/com/jingcheng/cms/controller/ArticleController.java @@ -1,6 +1,7 @@ package com.jingcheng.cms.controller; import com.alibaba.fastjson.JSONObject; +import com.jingcheng.cms.constants.AppConstant; import com.jingcheng.cms.model.Category; import com.jingcheng.cms.service.ArticleSerive; import com.jingcheng.cms.util.AjaxResult; @@ -20,8 +21,6 @@ import java.util.List; @RestController @RequestMapping("/api/article") public class ArticleController { - @Value("${localFilePath}") - private String localFilePath; @Autowired private ArticleSerive articleSerive; @@ -114,7 +113,7 @@ public class ArticleController { //文件后缀 String suffix = realFileName.substring(realFileName.lastIndexOf(".") + 1); realFileName = fileName + "." + suffix; - String path =localFilePath; + String path = System.getProperty("user.dir")+ "\\upload\\"; //检查该路径对应的目录是否存在. 如果不存在则创建目录 File dir=new File(path); if (!dir.exists()) { diff --git a/src/main/resources/application-production.yml b/src/main/resources/application-production.yml index d13bee3..3209e17 100644 --- a/src/main/resources/application-production.yml +++ b/src/main/resources/application-production.yml @@ -59,7 +59,6 @@ upload: export: path: /tmp/export/ -localFilePath: upload/ wx: BASE_URI: https://api.weixin.qq.com