docs(zh-CN): translate code block(plain text) (#753)

Co-authored-by: neo <neo.dowithless@gmail.com>
This commit is contained in:
zdoc.app
2026-03-23 06:39:24 +08:00
committed by GitHub
parent fd2a8edb53
commit 4f6f587700
118 changed files with 1807 additions and 1835 deletions

View File

@@ -17,10 +17,10 @@ description: 从 ~/.claude/sessions/ 加载最新的会话文件,并从上次
## 用法
```
/resume-session # loads most recent file in ~/.claude/sessions/
/resume-session 2024-01-15 # loads most recent session for that date
/resume-session ~/.claude/sessions/2024-01-15-session.tmp # loads a specific legacy-format file
/resume-session ~/.claude/sessions/2024-01-15-abc123de-session.tmp # loads a current short-id session file
/resume-session # 加载 ~/.claude/sessions/ 目录下最新的文件
/resume-session 2024-01-15 # 加载该日期最新的会话
/resume-session ~/.claude/sessions/2024-01-15-session.tmp # 加载特定的旧格式文件
/resume-session ~/.claude/sessions/2024-01-15-abc123de-session.tmp # 加载当前短ID格式的会话文件
```
## 流程
@@ -55,31 +55,31 @@ description: 从 ~/.claude/sessions/ 加载最新的会话文件,并从上次
使用以下确切格式回复一份结构化简报:
```
SESSION LOADED: [actual resolved path to the file]
会话已加载:[文件的实际解析路径]
════════════════════════════════════════════════
PROJECT: [project name / topic from file]
项目:[文件中的项目名称/主题]
WHAT WE'RE BUILDING:
[2-3 sentence summary in your own words]
我们正在构建什么:
[用你自己的话总结 2-3 句话]
CURRENT STATE:
Working: [count] items confirmed
🔄 In Progress: [list files that are in progress]
🗒️ Not Started: [list planned but untouched]
当前状态:
已完成:[数量] 项已确认
🔄 进行中:[列出进行中的文件]
🗒️ 未开始:[列出计划但未开始的文件]
WHAT NOT TO RETRY:
[list every failed approach with its reason — this is critical]
不应重试的内容:
[列出每个失败的方法及其原因——此部分至关重要]
OPEN QUESTIONS / BLOCKERS:
[list any blockers or unanswered questions]
待解决问题/阻碍:
[列出任何阻碍或未解答的问题]
NEXT STEP:
[exact next step if defined in the file]
[if not defined: "No next step defined — recommend reviewing 'What Has NOT Been Tried Yet' together before starting"]
下一步:
[如果文件中已定义,则列出确切下一步]
[如果未定义:"未定义下一步——建议在开始前共同回顾'尚未尝试的方法'"]
════════════════════════════════════════════════
Ready to continue. What would you like to do?
准备就绪。您希望做什么?
```
### 步骤 4等待用户
@@ -117,32 +117,31 @@ Ready to continue. What would you like to do?
SESSION LOADED: /Users/you/.claude/sessions/2024-01-15-abc123de-session.tmp
════════════════════════════════════════════════
PROJECT: my-app — JWT Authentication
项目:my-app — JWT 认证
WHAT WE'RE BUILDING:
User authentication with JWT tokens stored in httpOnly cookies.
Register and login endpoints are partially done. Route protection
via middleware hasn't been started yet.
构建目标:
使用存储在 httpOnly cookie 中的 JWT 令牌实现用户认证。
注册和登录端点已部分完成。通过中间件进行路由保护尚未开始。
CURRENT STATE:
Working: 3 items (register endpoint, JWT generation, password hashing)
🔄 In Progress: app/api/auth/login/route.ts (token works, cookie not set yet)
🗒️ Not Started: middleware.ts, app/login/page.tsx
当前状态:
已完成3 项注册端点、JWT 生成、密码哈希)
🔄 进行中:app/api/auth/login/route.ts(令牌有效,但 cookie 尚未设置)
🗒️ 未开始:middleware.tsapp/login/page.tsx
WHAT NOT TO RETRY:
❌ Next-Auth — conflicts with custom Prisma adapter, threw adapter error on every request
❌ localStorage for JWT — causes SSR hydration mismatch, incompatible with Next.js
需避免的事项:
❌ Next-Auth — 与自定义 Prisma 适配器冲突,每次请求均抛出适配器错误
❌ localStorage 存储 JWT — 导致 SSR 水合不匹配,与 Next.js 不兼容
OPEN QUESTIONS / BLOCKERS:
- Does cookies().set() work inside a Route Handler or only Server Actions?
待解决问题 / 阻碍:
- cookies().set() 在路由处理器中是否有效,还是仅适用于服务器操作?
NEXT STEP:
In app/api/auth/login/route.ts — set the JWT as an httpOnly cookie using
下一步:
app/api/auth/login/route.ts 中 — 使用以下方式将 JWT 设置为 httpOnly cookie
cookies().set('token', jwt, { httpOnly: true, secure: true, sameSite: 'strict' })
then test with Postman for a Set-Cookie header in the response.
随后使用 Postman 测试响应中是否包含 Set-Cookie 标头。
════════════════════════════════════════════════
Ready to continue. What would you like to do?
准备继续。您希望做什么?
```
***