Skip to content

fix: HTTP 下 crypto.randomUUID 不可用导致无法开始文字面试 - #70

Open
38680050 wants to merge 1 commit into
Snailclimb:masterfrom
38680050:fix/http-crypto-randomuuid-fallback
Open

38680050 wants to merge 1 commit into
Snailclimb:masterfrom
38680050:fix/http-crypto-randomuuid-fallback

Conversation

@38680050

Copy link
Copy Markdown

Summary

  • 在 http://公网IP 等非 Secure Context 环境下,crypto.randomUUID 不存在,点击「开始文字面试」会抛 TypeError: crypto.randomUUID is not a function,页面无跳转。
  • 新增 createUuid():优先 crypto.randomUUID,否则用 getRandomValues / Math.random 兜底;替换 InterviewHubPage / Layout / App 中的调用。

Test plan

  • 用 http://localhost 开始文字面试,行为与原来一致
  • 用 http://公网IP:端口(非 HTTPS)点击「开始文字面试」,应能进入创建页并正常生成题目
  • 确认控制台不再出现 crypto.randomUUID is not a function

HTTP deployments on a public IP are not a Secure Context, so
crypto.randomUUID is missing and starting a text interview throws.
Use a small createUuid helper with getRandomValues/Math.random fallbacks.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant