Cnode源码疑问
发布于 9 年前 作者 yxfanxiao 3274 次浏览 最后一次编辑是 8 年前 来自 问答

Cnode源码中: router:

// home page router.get(’/’, site.index);

在index里渲染了以下

res.render(‘index’, { topics: topics, current_page: page, list_topic_count: limit, tops: tops, no_reply_topics: no_reply_topics, pages: pages, tabs: config.tabs, tab: tab, pageTitle: tabName && (tabName + ‘版块’), });

在view中

<% if (typeof(user) !== ‘undefined’ || current_user) { %>

之前index中并没有渲染user 或者current_user啊?? @alsotang

6 回复

也没有看到用session或者cookie的呀。。

仔细看。。

@alsotang 抱歉,看了好久了,真的找不到啊! 求指点一下!

@yxfanxiao 这类东西每次请求都会校验,是作为中间件存在的,看看middleware里

@luoyjx 谢谢!看到在哪了。

给不知道的同学

middlewares/auth

回到顶部