Ver código fonte

简历管理代码联调测试问题修改。

zhanglfluofei 8 meses atrás
pai
commit
c8cb1e6ec4

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/ResumeController.java

@@ -112,12 +112,13 @@ public class ResumeController extends BaseController
             String originalFilename = file.getOriginalFilename();
             String suffix = originalFilename.substring(originalFilename.lastIndexOf("."));
             String fileName = FileUploadUtils.upload(path, file);
+            String newFileName = com.ruoyi.common.utils.file.FileUtils.getName(fileName);
 
             // 上传位置
             SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
             String ymd = sdf.format(new Date());
             String lastPath = "/" + ymd + "/";
-            String fileUrl = path + lastPath + fileName;
+            String fileUrl = path + lastPath + newFileName;
 
             if(suffix.equals(".doc")||suffix.equals(".docx")){
                 List<String> content = null;
@@ -134,7 +135,6 @@ public class ResumeController extends BaseController
                 Resume resume = ResumeAnalysisUtil.toResumeAnalysis(content);
                 //处理文件信息
                 String url = serverConfig.getUrl() + fileName;
-                String newFileName = com.ruoyi.common.utils.file.FileUtils.getName(fileName);
                 ResumeFile resumeFile = new ResumeFile();
                 resumeFile.setUploadPath(url);
                 resumeFile.setUploadName(newFileName);