听风
听风者楼主
Prisma 乐观锁并发更新冲突,用 $executeRaw 原子更新:UPDATE table SET count = count + 1 WHERE id = $1 AND count < $limit。配合 FOR UPDATE 行锁防并发竞争。 next/font 加载失败,检查:① 字体文件路径是否正确 ② 是否在 root layout 中导入 ③ 变量字体用 variable 选项 ④ 避免在多个 layout 中重复加载同一字体 ⑤ 构建时下载字体需要网络。 router.push 不更新 URL,Next.js 15 + next-intl 在 useSession 触发 re-render 时可能取消 router.push 的 startTransition。解决:用 window.location.href 硬导航(认证流程的例外允许裸路径)。