# 隐蔽未实现接口与逻辑清单
本报告聚焦于"看起来已实现、实际未接通或存在断层"的功能点。这些问题在 mock 演示阶段不易察觉,切换真实后端后会表现为数据丢失、页面空态、交互无效等事故。
与第一份报告(《静态模拟数据残留审计报告》)互补,本报告不再重复 mock 数据源、store 初始化、伪 API 层等已知问题。
---
## 一、登录态与持久化缺失
### 1.1 记住登录状态 — 纯展示控件
登录页渲染了"记住登录状态"复选框,但该控件未被表单注册,无任何读取或写入逻辑。
| 位置 | 内容 |
| ------------------------------ | -------------------------------------------------------------------------- |
| `app/(auth)/login/page.tsx:86` | `` — 未绑定 `register("remember")` 或 `useState` |
### 1.2 登录态无持久化 — 刷新即丢
全仓库未发现 `localStorage`、`sessionStorage`、`cookie` 写入,也未使用 `zustand/middleware` 的 `persist`。`store/auth.ts` 的 `login()` 仅写内存态,页面刷新后回到未登录状态。
**影响**:切真实后端后,如果前端仍依赖 Zustand 内存态判断登录,刷新会导致用户被踢出。
---
## 二、身份与实体模型错位
### 2.1 当前用户与店铺/打手 ID 不匹配 — 后台大面积空态
登录固定为 `mockUsers[0]`(id=`u1`),但 mock 数据中的店铺 owner 是 `u10`/`u11`/`u12`,打手是 `u5`/`u6` 起。
| 位置 | 内容 |
| -------------------------------------- | ---------------------------------------------- |
| `lib/mock/users.ts:119` | `currentUser = mockUsers[0]` — 固定 `u1` |
| `lib/mock/shops.ts:7` 起 | 店铺 owner 为 `u10`、`u11`、`u12` |
| `lib/mock/players.ts:7` 起 | 打手 user 从 `u5` 开始 |
| `lib/domain/resolve-current-shop.ts:5` | `shops.find(shop => shop.owner.id === userId)` |
**结果**:用户切换到店主身份后,`resolveOwnerShop` 始终返回 `null`,以下页面全部显示"当前账号没有可管理的店铺":
- `app/(dashboard)/dashboard/shop/employees/page.tsx:67`
- `app/(dashboard)/dashboard/shop/rules/page.tsx:29`
- `app/(dashboard)/dashboard/shop/income/page.tsx:28`
- `app/(dashboard)/dashboard/shop/page.tsx` 同理
- `app/(dashboard)/dashboard/shop/templates/page.tsx` 同理
- `app/(dashboard)/dashboard/shop/orders/page.tsx` 同理
### 2.2 打手主页链接指向不存在的打手
导航栏在 player 身份下跳转 `/player/${user.id}`(`components/header.tsx:88`),但 `user.id` 是 `u1`,`mockPlayers` 中没有 id 为 `u1` 的打手,会触发 `notFound()`(`app/(main)/player/[id]/page.tsx:25`)。
---
## 三、用户动作无持久化 — 刷新即回退
以下交互在前端有即时反馈,但数据仅存在于 Zustand 内存态,刷新页面或换设备后全部丢失。
### 3.1 点赞
| 位置 | 行为 |
| --------------------------------------- | --------------------------------------------------------------------- |
| `components/post-like-button.tsx:21-32` | 调用 `togglePostLike` → `store/posts.ts:50-61` 本地翻转 `liked` 并 ±1 |
### 3.2 评论
| 位置 | 行为 |
| ------------------------------------- | ------------------------------------------------ |
| `components/post-comments.tsx:29-52` | 调用 `addComment` → `store/comments.ts` 本地追加 |
| `components/post-comment-count.tsx:3` | 读 `useCommentStore` 本地计数 |
### 3.3 收藏
| 位置 | 行为 |
| -------------------------------------- | ----------------------------------------------------- |
| `components/favorite-button.tsx:29-33` | 调用 `toggleFavorite` → `store/favorites.ts` 本地增删 |
### 3.4 通知已读
| 位置 | 行为 |
| -------------------------------------- | ----------------------------------------------------------------------- |
| `app/(account)/notifications/page.tsx` | 调用 `markAsRead` / `markAllAsRead` → `store/notifications.ts` 本地标记 |
| `components/header.tsx:81-83` | 未读数通过 `.filter(n => !n.read).length` 本地计算 |
### 3.5 设置保存
| 位置 | 行为 |
| --------------------------------- | ---------------------------------------------------- |
| `app/(account)/settings/page.tsx` | 昵称、简介、通知偏好等修改仅写 `useAuthStore` 内存态 |
---
## 四、上传功能 — 占位或 Object URL
所有"上传"操作要么是纯占位 UI,要么使用 `URL.createObjectURL` 生成本地临时链接,刷新后失效。
### 4.1 头像上传
| 位置 | 行为 |
| ------------------------------------ | ------------------------------------------------------------- |
| `app/(account)/settings/page.tsx:75` | `setAvatar(URL.createObjectURL(file))` — 本地预览,无上传请求 |
### 4.2 聊天图片发送
| 位置 | 行为 |
| ------------------------------------ | --------------------------------------------------------------------------------- |
| `app/(order)/chat/[id]/page.tsx:152` | `sendImageMessage(session.id, URL.createObjectURL(file))` — blob URL 作为消息内容 |
### 4.3 争议证据上传
| 位置 | 行为 |
| --------------------------------------- | ------------------------------------------------------------------------------- |
| `app/(order)/dispute/[id]/page.tsx:88` | `URL.createObjectURL(file)` 生成预览,提交时传入 store |
| `app/(order)/dispute/[id]/page.tsx:102` | `URL.revokeObjectURL` 移除时释放 — 说明开发者意识到了临时性,但未替换为真实上传 |
### 4.4 身份认证证明材料 — 纯占位
| 位置 | 行为 |
| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `app/(account)/verify/page.tsx:170-181` | 三个 `