Closed zhangwei900808 closed 4 years ago
如果设置signed:true,重新运行是好的,
config.cookies = {
httpOnly: false,
signed: true
}
https://eggjs.org/zh-cn/core/cookie-and-session.html 请仔细阅读该文档。已经说的无比详细了。
OK,全局设置了signed: false,获取的时候也要设置signed: false!
let isLogin = this.ctx.cookies.get('isLogin', {
signed: false,
});
在example/ssr-with-ts实例中,我设置cookie
并且config.default.ts配置cookie
运行项目,打印结果显示undefined