当我在 _app.js 文件的 getInitialPros 中使用 axios 发送 get 请求时,next.js 应用程序中出现此错误。
if (typeof window === "undefined") {
// user = await checkAuth(ctx);
// const token = ctx.req.headers.cookie;
console.log("TOKEN", ctx.req.headers);
if (ctx.req && ctx.req.headers.cookie) {
try {
res = await axiosClient("get", { cookie: ctx.req.headers.cookie }).get(
"/auth/currentuser"
);
user = res.data;
console.log("USER IN SERVER SIDE", user);
ctx.store.dispatch(setAuthenticatedUser(res.data));
} catch (err) {
console.log("ERROR in APP", err);
// console.log("USER FOUND IN APP.JS", res.data);
ctx.store.dispatch(removeAuthenticatedUser());
}
}
} else {
try {
res = await axiosClient("get").get("/auth/currentuser"); …Run Code Online (Sandbox Code Playgroud) 我无法在我的 flutter 应用程序中使用 mixin,它说:
类“UserModel”不能用作 mixin,因为它扩展了 Object 以外的类
