Files
CarLog/debug-page-loading-spinner.md
wsh5485 fe17886ac4 feat: 洗车管理系统 v2.8 — 个人 detailer 单用户全栈应用
- 车辆 / 洗车 / 加油 / 充电 / 保养 / 保险 完整 CRUD + 软删
- AI 截图识别(5 类型 OCR schema):OpenAI 兼容 + MiniMax M3
- 化学品 / Grocy 实例对接 + 库存镜像同步
- 仪表盘:30 天频次 + 健康度 + 同比环比 + 油价趋势 + 年均养护
- 月度报表:Excel 6 sheet + PDF
- PWA:manifest / SW / 离线缓存 / iOS 引导
- 安全:bcrypt + CSRF + 登录锁定(IP/用户/全局三级)+ 401 自动跳登录 + 表单草稿
- 高 ROI 8 功能:里程/提醒/成本/搜索/标签/通知/同比/成就
- 3 个新 migration(0016/0017/0018)+ 18 个迁移全幂等
- 101/101 测试通过(含 ipRateLimit / CSRF / retry / stats / tags / notifications)
- 部署:宝塔面板文档 + PM2 + Nginx
2026-06-20 21:11:54 +08:00

26 lines
2.0 KiB
Markdown

# Debug Session: page-loading-spinner
**Status**: [OPEN]
**Symptom**: http://localhost:5173/ shows a loading spinner / "转圈圈" - page never finishes loading
**User-reported**: 2026-06-19
**Environment**:
- macOS, Vite dev server on :5173 (PID 28109), Node server on :8787 (PID 52581)
- DB: MySQL @ 162.14.110.130:33306 (carlog) — `.setup_done` present
- API health: 200 OK, /api/auth/me → 401 (expected for unauthenticated)
- HTML / main.js / proxied /api endpoints all return quickly
## Hypotheses
1. **H1 — Auth bootstrap redirect loop**: `/api/auth/me` returns 401, the axios 401 interceptor fires `location.href = '/login?redirect=%2F'`, hard navigation reloads page, the same chain runs again, the browser tab keeps showing the loading state of a SPA re-mount.
2. **H2 — Home.vue `loading = true` stuck**: User is already logged in (session cookie valid), lands on `/` (Home), the 6 parallel API calls in `Home.vue#onMounted` never resolve (one of them hangs → `Promise.all` never settles → `loading.value` stays `true` → "加载中…" rendered forever).
3. **H3 — Vite HMR / module error**: A recent code change in client broke a module, throwing on import; the Vue app never mounts, only `<div id="app"></div>` is visible and the browser tab shows loading.
4. **H4 — Login page itself renders a spinner**: After redirect to `/login`, something on the Login page (an external CSS or font request, etc.) keeps the page in a "spinning" state perceived as still loading.
5. **H5 — Server DB query hanging for Home's API**: One of the 6 endpoints (e.g. `/stats/overview`, `/dashboard/extra`) hits a long-running SQL on the remote MySQL; the request times out at 15s, but `loading` may not flip until all settle — perceived as a permanent spinner.
## Plan
- Step 1: Start debug server (collector) and add light instrumentation
- Step 2: Reload the page; collect runtime evidence
- Step 3: Pick the right hypothesis and apply a minimal fix
- Step 4: Re-run and compare pre/post logs
- Step 5: Cleanup on user confirmation