上传文件修改为返回完整路径

This commit is contained in:
RuoYi
2019-07-11 10:53:18 +08:00
parent 8dfa1834e3
commit 304da21e6d
6 changed files with 9 additions and 14 deletions

View File

@@ -27,11 +27,6 @@ public class CommonController
{
private static final Logger log = LoggerFactory.getLogger(CommonController.class);
/**
* 文件上传路径
*/
public static final String UPLOAD_PATH = "/profile/upload/";
@Autowired
private ServerConfig serverConfig;
@@ -82,7 +77,7 @@ public class CommonController
String filePath = Global.getUploadPath();
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + UPLOAD_PATH + fileName;
String url = serverConfig.getUrl() + fileName;
AjaxResult ajax = AjaxResult.success();
ajax.put("fileName", fileName);
ajax.put("url", url);