From e3edebede58d3034f6d1a3d49f8267f88d31d937 Mon Sep 17 00:00:00 2001 From: Oasis Date: Fri, 16 Jun 2023 23:45:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E6=8F=90=E9=AB=98=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=8F=AF=E8=AF=BB=E6=80=A7=EF=BC=8C=E6=B7=BB=E5=8A=A0=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routes/BorrowGate.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/routes/BorrowGate.js b/routes/BorrowGate.js index 4457573..3efaddd 100644 --- a/routes/BorrowGate.js +++ b/routes/BorrowGate.js @@ -2,9 +2,11 @@ const express = require('express'); const router = express.Router(); const Borrow = require('../controllers/borrowCtrl'); -// router.post('/getBorrowList', Borrow.getBorrowList) +const { authenticateToken } = require('../util/JWT') + // 借书 -router.post('/borrowBook', Borrow.borrowBook) -router.post('/backBook', Borrow.backBook) +router.post('/borrowBook', authenticateToken, Borrow.borrowBook) +// 还书 +router.post('/backBook', authenticateToken, Borrow.backBook) module.exports = router \ No newline at end of file -- Gitee