...
|
...
|
@@ -120,13 +120,22 @@ const sortParams = (req, res, next) => { |
|
|
*/
|
|
|
const resolvePathParams = (req, res, next) => {
|
|
|
let queryParams = req.query;
|
|
|
let pathParams = req.params.pathParams;
|
|
|
|
|
|
// 1. 取 path 的参数
|
|
|
req.query = listParamsProcess.getParams(req.path);
|
|
|
req.query = listParamsProcess.getParams(pathParams);
|
|
|
|
|
|
// 2. 取查询字符串参数
|
|
|
_.assign(req.query, queryParams);
|
|
|
|
|
|
// 3. 取 params 参数
|
|
|
if (req.params) {
|
|
|
if (req.params.pathParams) {
|
|
|
delete req.params.pathParams;
|
|
|
}
|
|
|
_.assign(req.query, req.params);
|
|
|
}
|
|
|
|
|
|
if (req.query) {
|
|
|
_.forEach(req.query, (perParam, index) => {
|
|
|
req.query[index] = stringProcess.paramsFilter(perParam);
|
...
|
...
|
@@ -139,7 +148,8 @@ const resolvePathParams = (req, res, next) => { |
|
|
* 解析 Path 类型泛商品列表异步请求中 URL 的参数
|
|
|
*/
|
|
|
const resolvePathParamsAjax = (req, res, next) => {
|
|
|
let currentUrlParams = listParamsProcess.getParams(req.query.currentUrl);
|
|
|
let pathParams = _.last(_.split(req.query.currentUrl, '/'));
|
|
|
let currentUrlParams = listParamsProcess.getParams(pathParams);
|
|
|
|
|
|
delete req.query.currentUrl;
|
|
|
|
...
|
...
|
|