javascript - node.js flash 消息问题
问题描述
我正在尝试使用req.flash()
方法将消息闪烁到视图,但它闪烁 1 而不是字符串消息到视图。闪烁 1 的原因可能是什么?这是短代码:
return res.render('index', {
error_msg: req.flash('error_msg', 'Rooms in this category [1 - 350] cost N4000 per day, but room '
+ roomN + ' is currently occupied by another customer. Please check another room'),
success_msg: ''
})
解决方案
推荐阅读
- node.js - 包在 npm 列表中可见,但不是必需的
- r - 根据嵌套组中的组事件在数据框中生成新列
- c# - 奇怪的布局问题 MVVM .Net 4.7.2 App 控件消失
- ruby - 如何重构我的词频方法?
- windows - 将 Sublime Text 3 设置为 Windows 10 上的默认 .txt 编辑器
- regular-language - 语言 C={a,b} 上的正则表达式
- python - ValueError:检查目标时出错:预期dense_108有2维,但得到的数组形状为(36020、10、2)
- c++ - 听时 winsock“无效参数”错误
- java - 如何检测文件是否不是 utf-8 编码的?
- ruby - 向 Cosmos 添加额外的 CAN 接口