You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use while message = flash.shift() get value too cumbersome。
Some values are not my concern
I just want error_message value
Whether this can be req.flash('message') ?
I modified code
after flash('message') the 'message' be delete, no need to manually shift.
functionpush(type,msg){varres=this.res||this;varlocals=res.locals.flash;if(!msg){if(typeoftype==='string'&&locals.length){for(vari=0,l=locals.length;i<l;i++){if(locals[i]['type']===type){msg=locals[i]['message'];locals.splice(i,1);returnmsg;}}}return;}msg={message: msg,type: type}varmessages=res.locals.flash// do not allow duplicate flash messagesfor(vari=0;i<messages.length;i++){varmessage=messages[i]if(msg.type===message.type&&msg.message===message.message)returnthis}messages.push(msg)returnthis}
The text was updated successfully, but these errors were encountered:
use while message = flash.shift() get value too cumbersome。
Some values are not my concern
I just want error_message value
Whether this can be req.flash('message') ?
I modified code
after flash('message') the 'message' be delete, no need to manually shift.
The text was updated successfully, but these errors were encountered: