node.js - app.use的参数,get不到
黄舟
黄舟 2017-04-17 15:28:45
0
4
390

不知道怎么表达,反正就是报错了

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(4)
刘奇

Obviously your username is not defined
Try adding an if judgment to your second middleware

左手右手慢动作

Just take it directly when you use it,

洪涛

The two usernames are in different scopes, of course they are undefined...

刘奇

These are the variables of two methods. The second one cannot refer to the username in the first method. Use req.session.username again and get it once.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template