feat: virtual company module, team projects, PWA dishes app, and startup scripts overhaul

- Add company module (3-tier org, CEO planning, parallel departments)
- Add company orchestrator, knowledge extractor, presets, scheduler
- Add company API endpoints, models, and frontend views
- Add 今天吃啥 PWA app (69 dishes, real images, offline support)
- Add team_projects output directory structure
- Add unified manage.ps1 for service lifecycle
- Add Windows startup guide v1.0
- Add TTS troubleshooting doc
- Update frontend (AgentChat UX overhaul, new views)
- Update backend (voice engine fix, multi-tenant, RBAC)
- Remove deprecated startup scripts and old docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-10 22:37:56 +08:00
parent 3483c6b3be
commit f2e65a8fbb
259 changed files with 39239 additions and 3148 deletions

View File

@@ -11,8 +11,8 @@ from typing import Optional
from fastapi import APIRouter, Depends, HTTPException, Query, UploadFile, File, Form
from app.core.config import settings
from app.core.security import decode_access_token
from app.core.database import get_db
from app.api.deps import require_admin
from sqlalchemy.orm import Session
from app.models.user import User
@@ -112,19 +112,10 @@ async def check_update(
# ─── 管理端版本列表 ──────────────────────────────────────────
async def _get_admin_user(token: str, db: Session) -> User:
"""验证管理员身份。"""
payload = decode_access_token(token)
if not payload:
raise HTTPException(status_code=401, detail="未登录")
user = db.query(User).filter(User.id == payload.get("sub")).first()
if not user or user.role != "admin":
raise HTTPException(status_code=403, detail="仅管理员可操作")
return user
@router.get("/versions")
async def list_versions():
async def list_versions(
_admin: User = Depends(require_admin()),
):
"""管理端:获取所有版本历史。"""
data = _load_versions()
return {
@@ -140,6 +131,7 @@ async def create_version(
platform: str = Form("android"),
force_update_min: str = Form(""),
release_notes: str = Form(""),
_admin: User = Depends(require_admin()),
):
"""管理端:上传 APK 并创建新版本。"""
_ensure_dirs()
@@ -189,7 +181,10 @@ async def create_version(
@router.delete("/versions/{version_str}")
async def delete_version(version_str: str):
async def delete_version(
version_str: str,
_admin: User = Depends(require_admin()),
):
"""管理端:删除版本记录(不删除 APK 文件)。"""
data = _load_versions()
versions = data.get("versions", [])