【发布时间】:2020-11-06 14:04:49
【问题描述】:
当我的会话变量person 不是null 或不是@987654323 时,我只想在我的ejs 模板 中显示dashboard @。
但它只是每次都显示仪表板。在我的日志语句中,person 的值为undefined。
<%= console.log(person); %>
<% if (person !== null || person !== undefined) { %>
<%- include("dashboard"); %>
<% } else { %>
<%- include("login"); %>
<% } %>
什么是正确的方法?
【问题讨论】:
标签: javascript node.js express rendering ejs