1234567891011121314151617181920212223242526272829303132333435363738 |
- const express = require('express');
- const { query } = require('express-validator');
- const check = require('../../middleware/check');
- const router = express.Router();
- // /* GET home page. */
- // router.get('/', async (req, res) => {
- // res.render('index', { title: 'Express' });
- // });
- // router.get('/test', check([query('id').notEmpty()]), async (req, res) => {
- // res.render('index', { title: 'Express' });
- // });
- router.get('/', async (req, res, next) => {
- // if (!req.admin) {
- // return res.redirect('/master/login');
- // }
- const business = req.cookies.token || req.session.business;
- // const admin = jwt.decode(token, jwtSecretAdmin);
- // if (!business) {
- // return res.redirect('/');
- // }
- res.render('index');
- });
- // // 登录
- // router.get('/login', (req, res) => {
- // if (req.business) {
- // return res.redirect('/');
- // }
- // const business = req.cookies.token || req.session.business;
- // // const admin = jwt.decode(token, jwtSecretAdmin);
- // if (business) {
- // return res.redirect('/');
- // }
- // res.render('index');
- // });
- module.exports = router;
|