Showing
2 changed files
with
5 additions
and
1 deletions
@@ -42,6 +42,10 @@ exports.downLoadData = (req, res, next) => { | @@ -42,6 +42,10 @@ exports.downLoadData = (req, res, next) => { | ||
42 | let codeArr = req.query.codeArr; | 42 | let codeArr = req.query.codeArr; |
43 | let yohoApp = req.yoho.isApp && !req.yoho.isMarsApp; | 43 | let yohoApp = req.yoho.isApp && !req.yoho.isMarsApp; |
44 | 44 | ||
45 | + if (!codeArr) { | ||
46 | + return; | ||
47 | + } | ||
48 | + | ||
45 | req.ctx(family).downLoadData(codeArr, yohoApp).then(result => { | 49 | req.ctx(family).downLoadData(codeArr, yohoApp).then(result => { |
46 | res.json(result); | 50 | res.json(result); |
47 | }).catch(next); | 51 | }).catch(next); |
@@ -142,7 +142,7 @@ class familyModel extends global.yoho.BaseModel { | @@ -142,7 +142,7 @@ class familyModel extends global.yoho.BaseModel { | ||
142 | code: 200 | 142 | code: 200 |
143 | }).then((result) => { | 143 | }).then((result) => { |
144 | 144 | ||
145 | - if (result.data.mars && result.data.mars.vipLevelList.length > 0) { | 145 | + if (result.data && result.data.mars && result.data.mars.vipLevelList.length > 0) { |
146 | _.forEach(result.data.mars.vipLevelList, function(val) { | 146 | _.forEach(result.data.mars.vipLevelList, function(val) { |
147 | val.name = 'Lv.' + val.level; | 147 | val.name = 'Lv.' + val.level; |
148 | }); | 148 | }); |
-
Please register or login to post a comment