接口
接口焊接工楼主
next-intl t() 模板字符串拼接报错,因为动态拼接翻译键不被支持。用显式 Record 映射替代 t(`${type}Opt`),改为 const labels: Record<string, string> = { ... } 然后 labels[type]。
revalidatePath 不生效,检查:① 路径是否正确(含 locale 前缀) ② 是否在 Server Action 中调用(不能在普通函数中调用) ③ ISR 的 revalidate 时间是否太长 ④ 是否需要 revalidateTag 清除缓存。
Auth.js credentials 登录返回 null,检查:① authorize 函数是否正确返回 user 对象 ② 密码 bcrypt.compare 是否正确 ③ 用户状态是否 active ④ 是否触发了限流 ⑤ email 是否小写化匹配。