Commit 83856b07b1a9df5e9a9389f36da4520876b5cdcd
1 parent
6616abb1
fix: 修改上传url
Showing
4 changed files
with
6 additions
and
5 deletions
ruoyi-admin/src/main/java/com/ruoyi/service/AppService.java
| @@ -57,13 +57,14 @@ public class AppService { | @@ -57,13 +57,14 @@ public class AppService { | ||
| 57 | // 校验文件 | 57 | // 校验文件 |
| 58 | checkFile(file); | 58 | checkFile(file); |
| 59 | // 上传文件路径 | 59 | // 上传文件路径 |
| 60 | - String filePath = RuoYiConfig.getUploadPath(); | 60 | + String filePath = RuoYiConfig.getUploadPath() + apkPath; |
| 61 | // 上传并返回新文件名称 | 61 | // 上传并返回新文件名称 |
| 62 | - String fileName = apkPath + System.currentTimeMillis() + "_" + file.getOriginalFilename(); | 62 | + String fileName = "app.apk"; |
| 63 | // 获取相对路径 | 63 | // 获取相对路径 |
| 64 | String absPath = FileUploadUtils.getAbsoluteFile(filePath, fileName).getAbsolutePath(); | 64 | String absPath = FileUploadUtils.getAbsoluteFile(filePath, fileName).getAbsolutePath(); |
| 65 | // 上传文件 | 65 | // 上传文件 |
| 66 | file.transferTo(Paths.get(absPath)); | 66 | file.transferTo(Paths.get(absPath)); |
| 67 | + fileName = FileUploadUtils.getPathFileName(filePath, fileName); | ||
| 67 | // 返回url | 68 | // 返回url |
| 68 | String url = serverConfig.getUrl() + fileName; | 69 | String url = serverConfig.getUrl() + fileName; |
| 69 | AjaxResult ajax = AjaxResult.success(); | 70 | AjaxResult ajax = AjaxResult.success(); |
ruoyi-admin/src/main/resources/application-druid-dev.yml
ruoyi-admin/src/main/resources/application-druid-prd.yml
ruoyi-admin/src/main/resources/application-druid-uat.yml