Commit 5728b199 authored by liuyang's avatar liuyang

fix bug

parent bc72d320
...@@ -246,14 +246,14 @@ public class RainbowPlanController extends BaseController<Object> { ...@@ -246,14 +246,14 @@ public class RainbowPlanController extends BaseController<Object> {
String[] originalFileName = info.getFile().getOriginalFilename().split("\\."); String[] originalFileName = info.getFile().getOriginalFilename().split("\\.");
String fileName = info.getUid() + "." + originalFileName[originalFileName.length-1]; String fileName = user.getId() + "." + originalFileName[originalFileName.length-1];
String rootPath = rb.getString("file_path"); String rootPath = rb.getString("file_path");
if (StringUtils.isNotBlank(user.getAvatar())) { if (StringUtils.isNotBlank(user.getAvatar())) {
File oldFile = new File(rootPath + user.getAvatar()); File oldFile = new File(rootPath + user.getAvatar());
FileUtils.forceDelete(oldFile); FileUtils.forceDelete(oldFile);
} }
File destFile = new File(rootPath + uploadWishImagePath,fileName); File destFile = new File(rootPath + uploadAvatarPath,fileName);
FileUtils.writeByteArrayToFile(destFile,info.getFile().getBytes()); FileUtils.writeByteArrayToFile(destFile,info.getFile().getBytes());
user.setAvatar(uploadAvatarPath + File.separator + fileName); user.setAvatar(uploadAvatarPath + File.separator + fileName);
......
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