Showing
1 changed file
with
7 additions
and
7 deletions
@@ -33,19 +33,19 @@ const list = (req, res, next) => { | @@ -33,19 +33,19 @@ const list = (req, res, next) => { | ||
33 | Promise.all([searchModel.getAllBrandNames(), searchModel.getClassNames()]).then((result) => { | 33 | Promise.all([searchModel.getAllBrandNames(), searchModel.getClassNames()]).then((result) => { |
34 | if (query) { | 34 | if (query) { |
35 | _.forEach(result[0], function(obj) { | 35 | _.forEach(result[0], function(obj) { |
36 | - if (query === obj.brandDomain) { // 精确查品牌域名 | 36 | + if (query === obj.brandDomain && /^[a-z0-9]+$/i.test(obj.brandName)) { // 精确查品牌域名 |
37 | domain = query; | 37 | domain = query; |
38 | return false; | 38 | return false; |
39 | } | 39 | } |
40 | - if (query === obj.brandName) { // 精确查品牌名称 | 40 | + if (query === obj.brandName && /^[a-z0-9]+$/i.test(obj.brandName)) { // 精确查品牌名称 |
41 | domain = obj.brandName; | 41 | domain = obj.brandName; |
42 | return false; | 42 | return false; |
43 | } | 43 | } |
44 | 44 | ||
45 | - if (obj.brandDomain.indexOf(query) > 0) { // 模糊查品牌域名 | ||
46 | - domain = obj.brandDomain; | ||
47 | - return false; | ||
48 | - } | 45 | + // if (obj.brandDomain.indexOf(query) > 0) { // 模糊查品牌域名 |
46 | + // domain = obj.brandDomain; | ||
47 | + // return false; | ||
48 | + // } | ||
49 | }); | 49 | }); |
50 | 50 | ||
51 | // 跳转到品牌商品列表页 | 51 | // 跳转到品牌商品列表页 |
@@ -56,7 +56,7 @@ const list = (req, res, next) => { | @@ -56,7 +56,7 @@ const list = (req, res, next) => { | ||
56 | 56 | ||
57 | }, domain); | 57 | }, domain); |
58 | 58 | ||
59 | - res.redirect(url); | 59 | + return res.redirect(url); |
60 | } | 60 | } |
61 | 61 | ||
62 | // 品类名称为空时跳出 | 62 | // 品类名称为空时跳出 |
-
Please register or login to post a comment