| | |
| | | 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.http.MediaType; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | private ServerConfig serverConfig; |
| | | |
| | | private static final String FILE_DELIMETER = ","; |
| | | |
| | | @Value("${custom.upload.network-path}") |
| | | private String networkPath; |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | |
| | | String filePath = RuoYiConfig.getUploadPath(); |
| | | // 上传并返回新文件名称 |
| | | String fileName = FileUploadUtils.upload(filePath, file); |
| | | String url = serverConfig.getUrl() + fileName; |
| | | String url = networkPath + fileName; |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("url", url); |
| | | ajax.put("fileName", fileName); |
| | |
| | | String filePath = RuoYiConfig.getUploadPath(); |
| | | // 上传并返回新文件名称 |
| | | String fileName = FileUploadUtils.upload(filePath, file); |
| | | String url = serverConfig.getUrl() + fileName; |
| | | String url = networkPath + fileName; |
| | | HashMap<String, Object> stringObjectHashMap = new HashMap<>(); |
| | | stringObjectHashMap.put("url", url); |
| | | stringObjectHashMap.put("fileName", fileName); |
| | |
| | | { |
| | | // 上传并返回新文件名称 |
| | | String fileName = FileUploadUtils.upload(filePath, file); |
| | | String url = serverConfig.getUrl() + fileName; |
| | | String url = networkPath + fileName; |
| | | urls.add(url); |
| | | fileNames.add(fileName); |
| | | newFileNames.add(FileUtils.getName(fileName)); |