Skip to content

Commit

Permalink
feat: 新增用學期成績檢查登入狀態的API
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinlinlee committed Sep 3, 2021
1 parent 9c50621 commit c250328
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions routes/api/stuInfo/controller/get_loginStatus.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const _ = require('lodash');
const { getScore } = require('../../Scores/controller/get_Scores');
module.exports = async function(req ,res)
{
let { scores, ranks } = await getScore(req);
if (!scores) {
req.flash('error', '學校系統逾時,請重新登入');
req.logout();
return res.status(401).send();
}
return res.status(200).send();
}
1 change: 1 addition & 0 deletions routes/api/stuInfo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ const router = express.Router();

router.get('/' , require('./controller/get_StuInfo'))
router.post('/' , require('./controller/post_StuInfo'));
router.get('/loginStatus', require('./controller/get_loginStatus'));

module.exports = router;

0 comments on commit c250328

Please sign in to comment.