123456789101112131415161718192021222324252627282930313233343536 |
- const { MENU, AUTH, host } = require('../config');
- // 分页修改中间件
- module.exports = () => {
- return (req, res, next) => {
- res.renderEx = (view, option) => {
- !option.keywords && (option.keywords = '');
- !option.description && (option.description = '');
- res.render(view, {
- ...option,
- menuData: MENU,
- signStatus: req.uid,
- // user: req.user,
- auth: req.uid
- ? [
- {
- url: 'https://www.fuxicarbon.com/userCenter/basic',
- value: '用户中心',
- },
- {
- url: 'https://www.fuxicarbon.com/sellCenter/basic',
- value: '商家中心',
- },
- {
- url: `https://www.fuxicarbon.com/logout?redirect=${encodeURIComponent(
- host + req.originalUrl
- )}`,
- value: '退出登录',
- },
- ]
- : null,
- });
- };
- next();
- };
- };
|