### 创建虚拟环境 ```bash # 使用 conda conda create --name lq_oauth2 python=3.12 conda activate lq_oauth2 ``` ### 启动服务 ✅ 开发环境: ```bash python run_server.py ``` ✅ 生产环境: ```bash uvicorn app.server.app:app --host 0.0.0.0 --port 8000 ``` ### 访问地址 - **API服务**: http://localhost:8000 - **API文档**: http://localhost:8000/docs - **前端地址**: http://localhost:3000 ### 默认登录账号 - **用户名**: `admin` - **密码**: `Admin123456` - **邮箱**: admin@example.com ### 依赖安装 ```bash pip install pymilvus -i https://mirrors.aliyun.com/pypi/simple/ pip install langchain_openai -i https://mirrors.aliyun.com/pypi/simple/ pip install langchain_milvus -i https://mirrors.aliyun.com/pypi/simple/ pip install minio -i https://mirrors.aliyun.com/pypi/simple/ pip install langchain-text-splitters -i https://mirrors.aliyun.com/pypi/simple/ langchain_openai 1.1.7 langchain_milvus 0.3.3 minio 7.2.20 ``` ### 问题修复记录 ✅ **所有登录问题已修复** (2026-01-15) 1. ✅ 数据库连接 - 密码URL编码 2. ✅ 密码验证 - 支持sha256和bcrypt格式 3. ✅ OAuth令牌表 - app_id可空 4. ✅ CORS配置 - 修正配置格式 5. ✅ 登出接口 - body参数可选 ### 相关文档 - [所有修复总结](../ALL_FIXES_SUMMARY.md) - 完整的问题修复记录 - [登录信息](../LOGIN_INFO.md) - 详细的登录说明 - [CORS修复](../CORS_FIX_SUMMARY.md) - CORS问题详解 - [登出修复](../LOGOUT_FIX.md) - 登出接口修复 ### 测试脚本 ```bash # 测试登录 python test_simple_login.py # 测试完整流程 python test_full_login_flow.py # 测试CORS python test_options_request.py # 测试登出 python test_logout.py ```