Commit acf20b51 authored by hezhen's avatar hezhen

修改上传图片

parent 3366b2fb
......@@ -51,7 +51,12 @@ public class UploadService {
//文件存放路径
String filePath = baseUploadPath + realFileRelPath;
//将文件写入指定位置
FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath));
File files=new File(filePath);
if(!files.exists()){
//创建目录
files.mkdirs();
}
FileUtils.copyInputStreamToFile(file.getInputStream(), files);
realFileRelPath= SystemConfig.XXMP_URL+realFileRelPath;
return realFileRelPath;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment