From 3d34b17459d2d8733d2229ff36441b473ec7f426 Mon Sep 17 00:00:00 2001 From: ck <851316342@qq.com> Date: Mon, 12 Apr 2021 11:56:44 +0800 Subject: [PATCH] up --- .../java/com/jingcheng/cms/controller/ArticleController.java | 5 ++--- src/main/resources/application-production.yml | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) 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