上传下载文件功能路径修改

This commit is contained in:
hehaibing-1996
2025-02-27 11:39:24 +08:00
parent 025703fe94
commit 9d05329170
3 changed files with 8 additions and 6 deletions

View File

@ -43,7 +43,9 @@
] ]
}, },
/* ios */ /* ios */
"ios" : {}, "ios" : {
"dSYMs" : false
},
/* SDK */ /* SDK */
"sdkConfigs" : {}, "sdkConfigs" : {},
"icons" : { "icons" : {

View File

@ -1,8 +1,8 @@
{ {
"hash": "29c858eb", "hash": "e52075f4",
"configHash": "a028522a", "configHash": "469f15e9",
"lockfileHash": "418b0517", "lockfileHash": "418b0517",
"browserHash": "316d81cf", "browserHash": "dfed43e0",
"optimized": {}, "optimized": {},
"chunks": {} "chunks": {}
} }

View File

@ -56,7 +56,7 @@ namespace WCS.WebApi.Controllers
} }
// 定义保存路径 // 定义保存路径
var savePath = Path.Combine(Directory.GetCurrentDirectory(), $"Files"); var savePath = Path.Combine(AppContext.BaseDirectory, $"Files");
// 确保文件夹存在 // 确保文件夹存在
if (!Directory.Exists(savePath)) if (!Directory.Exists(savePath))
{ {
@ -102,7 +102,7 @@ namespace WCS.WebApi.Controllers
public IActionResult downloadApp(string fileName) public IActionResult downloadApp(string fileName)
{ {
// 这里是文件的物理路径,你需要根据实际情况提供 // 这里是文件的物理路径,你需要根据实际情况提供
var filePath = Path.Combine(Directory.GetCurrentDirectory(), $"Files/{fileName}"); var filePath = Path.Combine(AppContext.BaseDirectory, $"Files/{fileName}");
// 检查文件是否存在 // 检查文件是否存在
if (!System.IO.File.Exists(filePath)) if (!System.IO.File.Exists(filePath))
{ {