You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
我在 app/layout 中定义了 Interceptor 但无效
I defined Interceptor in app/layout, but it doesn't work
`
import type { Metadata } from "next"
import "./globals.css"
import { client } from "@/service/gen/client.gen"
export const metadata: Metadata = {
title: "-",
description: "-",
}
async function myInterceptor(response) {
// do something
return response
}
// Supports async functions
client.interceptors.response.use(myInterceptor)
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode
}>) {
return (
<body className={
antialiased
}>{children})
}
`
Beta Was this translation helpful? Give feedback.
All reactions