fix: Windows compatibility and startup scripts
- Add explicit .env loading in config.py for Windows compatibility - Add backend directory to sys.path in main.py to fix module imports - Add start.bat and start-full.bat for Windows startup - Add frontend/package-lock.json for dependency tracking Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,9 +1,17 @@
|
||||
import base64
|
||||
import os
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
from pydantic import field_validator
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
# Load .env file explicitly - Windows compatibility
|
||||
# This ensures environment variables are loaded before Settings instantiation
|
||||
_env_path = Path(__file__).parent.parent.parent / '.env'
|
||||
if _env_path.exists():
|
||||
from dotenv import load_dotenv
|
||||
load_dotenv(_env_path, override=True)
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
"""应用配置,从环境变量加载."""
|
||||
|
||||
Reference in New Issue
Block a user