- 新增 FileStorageOptions 配置类 - 修改 FileUploadService 使用配置化路径 - 添加静态文件中间件支持文件访问 - 修复前端图片路径拼接问题
17 lines
433 B
C#
17 lines
433 B
C#
namespace MilitaryTrainingManagement.Configuration;
|
|
|
|
public class FileStorageOptions
|
|
{
|
|
public const string SectionName = "FileStorage";
|
|
|
|
/// <summary>
|
|
/// 文件存储基础路径(相对或绝对路径)
|
|
/// </summary>
|
|
public string BasePath { get; set; } = "./wwwroot/uploads";
|
|
|
|
/// <summary>
|
|
/// 访问文件的 URL 前缀
|
|
/// </summary>
|
|
public string UrlPrefix { get; set; } = "/uploads";
|
|
}
|