|
@@ -162,10 +162,20 @@ const resolvePathParamsAjax = (req, res, next) => { |
|
@@ -162,10 +162,20 @@ const resolvePathParamsAjax = (req, res, next) => { |
162
|
* 解析 Path 类型店铺商品列表异步请求中 URL 的参数
|
162
|
* 解析 Path 类型店铺商品列表异步请求中 URL 的参数
|
163
|
*/
|
163
|
*/
|
164
|
const resolveShopPathParamsAjax = (req, res, next) => {
|
164
|
const resolveShopPathParamsAjax = (req, res, next) => {
|
165
|
- let pathParams = _.last(_.split(req.query.currentUrl, '/'));
|
|
|
166
|
- let currentUrlParams = listParamsProcess.getParams(pathParams);
|
|
|
167
|
- let shopInfoPath = _.replace(req.query.currentUrl, `/${pathParams}`, '');
|
|
|
168
|
- let shopId = _.last(_.split(shopInfoPath, '-'));
|
165
|
+ let shopId;
|
|
|
166
|
+ let currentUrlParams;
|
|
|
167
|
+ let pathSplitArr = _.compact(_.split(req.query.currentUrl, '/'));
|
|
|
168
|
+ let pathParams = _.last(pathSplitArr);
|
|
|
169
|
+
|
|
|
170
|
+ if (pathSplitArr.length === 2) {
|
|
|
171
|
+ shopId = _.last(_.split(pathParams, '-'));
|
|
|
172
|
+ } else {
|
|
|
173
|
+ currentUrlParams = listParamsProcess.getParams(pathParams);
|
|
|
174
|
+
|
|
|
175
|
+ let shopInfoPath = _.replace(req.query.currentUrl, `/${pathParams}`, '');
|
|
|
176
|
+
|
|
|
177
|
+ shopId = _.last(_.split(shopInfoPath, '-'));
|
|
|
178
|
+ }
|
169
|
|
179
|
|
170
|
delete req.query.currentUrl;
|
180
|
delete req.query.currentUrl;
|
171
|
|
181
|
|