Authored by yyq

redirect

... ... @@ -10,6 +10,8 @@ const helpers = global.yoho.helpers;
const logger = global.yoho.logger;
const _ = require('lodash');
const handleFilterUrl = require(`${global.utils}/parameter`).fullParamToMinPath;
// 搜索相关接口
const searchApi = require('../models/search-api');
const list = require('../models/list');
... ... @@ -25,8 +27,8 @@ exports.index = (req, res, next) => {
let qs = '';
if (req.originalUrl && req.originalUrl.indexOf('.html') < 0 &&
req.originalUrl.indexOf('?') < 0 && !_.isEmpty(req.query)) {
return res.redirect(301, helpers.urlFormat(`${req.originalUrl}.html`));
!_.isEmpty(req.query)) {
return res.redirect(301, helpers.urlFormat(handleFilterUrl('/list', req.query)));
}
try {
... ...