From 511a1c27784b3882f2609c1ba6ca3d48244e1512 Mon Sep 17 00:00:00 2001 From: LingandRX <56020800+LingandRX@users.noreply.github.com> Date: Tue, 24 Dec 2024 23:17:13 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=88=A0=E9=99=A4=E6=9C=AA?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=9A=84=E8=BA=AB=E4=BB=BD=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E4=B8=AD=E9=97=B4=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除了 LoginUtil.js 文件中的 authenticateSeesion 方法 - 该方法已不再被任何地方调用,删除以简化代码库 --- utils/LoginUtil.js | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 utils/LoginUtil.js diff --git a/utils/LoginUtil.js b/utils/LoginUtil.js deleted file mode 100644 index 67949a1..0000000 --- a/utils/LoginUtil.js +++ /dev/null @@ -1,7 +0,0 @@ -exports.authenticateSeesion = async (req, res, next) => { - if (req.session.user) { - next() - } else { - res.status(401).json({ error: 'Unauthorized' }) - } -}