Skip to content

feat:新增帮助中心与问题反馈闭环 - #41

Merged
yydounai1234 merged 5 commits into
mainfrom
feat/help-center
Aug 4, 2026
Merged

feat:新增帮助中心与问题反馈闭环#41
yydounai1234 merged 5 commits into
mainfrom
feat/help-center

Conversation

@suerzzh

@suerzzh suerzzh commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

变更说明

为 UniSpeaking 增加帮助中心页面,并建立可供未登录用户使用的问题反馈闭环。

主要功能

帮助中心

  • 在个人中心“助手设置”下方增加“帮助与反馈”入口
  • 增加登录、注册页面的帮助中心入口
  • 支持未登录访问全部帮助页面
  • 提供帮助搜索、热门问题和分类浏览
  • 支持分类列表和文章详情
  • 适配桌面端和移动端
  • 保持 UniSpeaking 现有视觉风格

问题反馈

  • 未登录用户可以直接提交反馈
  • 提交成功后返回反馈编号和查询码
  • 支持通过反馈编号和查询码查询进度
  • 登录用户可以查看“我的反馈”
  • 浏览器尝试保存最近 10 条匿名反馈查询凭据
  • 支持已提交、处理中、已解决和已关闭状态
  • 支持展示管理员处理答复和更新时间

后端与安全

  • 使用 PostgreSQL 持久化反馈数据
  • 服务端只保存查询码的 SHA-256 摘要
  • 增加管理员反馈筛选、状态更新和答复接口
  • 管理接口校验 ADMIN 角色
  • 未修改现有业务接口或学习流程

新增路由

  • /help
  • /help/category/:categoryId
  • /help/article/:articleId
  • /help/feedback

新增接口

  • POST /api/feedbacks
  • GET /api/feedbacks/lookup/{feedbackNo}
  • GET /api/feedbacks/mine
  • GET /api/admin/feedbacks
  • PATCH /api/admin/feedbacks/{feedbackNo}

数据库变更

  • 新增 Flyway 迁移 V5__user_feedback.sql
  • 新增 user_feedback 表及相关索引

验证结果

  • 后端单元测试:294 项通过
  • PostgreSQL/Redis 集成测试:8 项通过
  • 后端覆盖率门禁:通过
  • 前端路由检查:41 项通过
  • 前端实时事件检查:通过
  • Vite 生产构建:通过
  • git diff --check:通过

本期未包含

  • 管理员可视化后台
  • 邮件或站内消息通知
  • 截图及附件上传
  • 帮助文章后端管理系统

建议重点检查

  • 无痕窗口直接访问 /help
  • 登录和注册页面的帮助中心入口
  • 匿名反馈提交及查询码保存
  • 匿名反馈进度查询
  • 登录用户的“我的反馈”
  • 管理员更新状态后用户端的答复展示
  • 帮助页面移动端布局

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary: one issue in the new anonymous help flow. The public feedback API still goes through the shared client path that sends any stored bearer token, so a stale session can turn an intended no-login submission/query into a 401 until auth is cleared.

return request("/api/auth/me");
}

export function createHelpFeedback(feedback) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These public help calls still use request(), which automatically attaches Authorization whenever a token exists. That means a stale/expired token in localStorage can make the anonymous feedback form fail with 401 before it reaches the public endpoint.

@yydounai1234 yydounai1234 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yydounai1234
yydounai1234 merged commit 007bc18 into main Aug 4, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants