diff --git a/.env b/.env index 7386012..015f8c9 100644 --- a/.env +++ b/.env @@ -78,6 +78,9 @@ WHISPER_MODEL=FunAudioLLM/SenseVoiceSmall # 聊天模型(可选,默认 gpt-3.5-turbo,可改为 gpt-4 等) CHAT_MODEL=Qwen/Qwen3-8B +# 识图模型 +OCR_MODEL=deepseek-ai/DeepSeek-OCR + # AI 会话超时时间 AI_SESSION_TIMEOUT=30m diff --git a/internal/config/config.go b/internal/config/config.go index f0885e0..17db8b5 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -47,24 +47,24 @@ type Config struct { FrontendURL string // AI configuration (OpenAI compatible) - OpenAIAPIKey string - OpenAIBaseURL string - WhisperModel string - ChatModel string + OpenAIAPIKey string + OpenAIBaseURL string + WhisperModel string + ChatModel string AISessionTimeout time.Duration // Image upload configuration - ImageUploadDir string - MaxImageSize int64 - AllowedImageTypes string - MaxImagesPerTx int + ImageUploadDir string + MaxImageSize int64 + AllowedImageTypes string + MaxImagesPerTx int } // Load loads configuration from environment variables func Load() *Config { cfg := &Config{ // Server - ServerPort: getEnv("SERVER_PORT", "8080"), + ServerPort: getEnv("SERVER_PORT", "2612"), Environment: getEnv("ENVIRONMENT", "development"), // Data directory @@ -99,7 +99,7 @@ func Load() *Config { GitHubClientID: getEnv("GITHUB_CLIENT_ID", ""), GitHubClientSecret: getEnv("GITHUB_CLIENT_SECRET", ""), GitHubRedirectURL: getEnv("GITHUB_REDIRECT_URL", ""), - FrontendURL: getEnv("FRONTEND_URL", "http://localhost:5173"), + FrontendURL: getEnv("FRONTEND_URL", "http://localhost:2613"), // AI (OpenAI compatible) OpenAIAPIKey: getEnv("OPENAI_API_KEY", ""), diff --git a/internal/handler/auth_handler.go b/internal/handler/auth_handler.go index c36d918..d17a1f6 100644 --- a/internal/handler/auth_handler.go +++ b/internal/handler/auth_handler.go @@ -5,9 +5,9 @@ import ( "fmt" "net/url" - "accounting-app/pkg/api" "accounting-app/internal/config" "accounting-app/internal/service" + "accounting-app/pkg/api" "github.com/gin-gonic/gin" ) @@ -181,7 +181,7 @@ func (h *AuthHandler) GitHubCallback(c *gin.Context) { return } - frontendURL := "http://localhost:5173" + frontendURL := "http://localhost:2613" if h.cfg != nil && h.cfg.FrontendURL != "" { frontendURL = h.cfg.FrontendURL }