首页 > 解决方案 > 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: ''
    })

标签: javascriptnode.jsexpress

解决方案


推荐阅读