RuoYi
2022-06-14 8ee702e4a21e6499b96bfc05a1012a4ae14f6736
ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/controller/SysFileController.java
@@ -3,7 +3,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
@@ -22,12 +21,6 @@
{
    private static final Logger log = LoggerFactory.getLogger(SysFileController.class);
    /**
     * 上传文件存储在本地的根路径
     */
    @Value("${file.path}")
    private String localFilePath;
    @Autowired
    private ISysFileService sysFileService;
@@ -40,7 +33,7 @@
        try
        {
            // 上传并返回访问地址
            String url = sysFileService.uploadFile(file, localFilePath);
            String url = sysFileService.uploadFile(file);
            SysFile sysFile = new SysFile();
            sysFile.setName(FileUtils.getName(url));
            sysFile.setUrl(url);