feat: 文件上传所需要的环境变量

This commit is contained in:
martsforever
2026-04-02 14:58:39 +08:00
parent 3565ac80ba
commit 5013218b24
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -11,3 +11,5 @@ LLM_KEY_DEEPSEEK=sk-a89d0ff9421a43fca5f0xxxxxxxxxxxx # Deepseek模型服务
SERVER_PORT = 7004 # 服务启动端口
SERVER_ENABLE_CORS = False # 是否允许跨域
SERVER_FILE_SAVE_PATH=/www/wwwroot/web/web/upload_file/ # 文件保存在服务器上的路径
SERVER_FILE_PUBLIC_PATH=/web/upload_file/ # 文件在浏览器上的访问路径
+2
View File
@@ -16,6 +16,8 @@ class EnvSettings(BaseSettings):
server_port: int = Field(..., env="SERVER_PORT")
server_enable_cors: bool = Field(..., env="SERVER_ENABLE_CORS")
server_file_save_path: str = Field(..., env='SERVER_FILE_SAVE_PATH')
server_file_public_path: str = Field(..., env='SERVER_FILE_PUBLIC_PATH')
class Config:
env_file = ".env"