For this, we will use the UUID module from npm. ... userId; if (!userId) { userId = uuid.v4(); res.cookie('userId', userId); } req.user = { id: userId }; ...
確定! 回上一頁