- 
Status changed to merged 
- 
mentioned in commit 797af59cff50069b3e317480df2130898cd0560b 
- 
判断ad_code是否存在 See merge request !287 
Showing
1 changed file
pages/user/index/index.js
| @@ -66,7 +66,8 @@ Page({ | @@ -66,7 +66,8 @@ Page({ | ||
| 66 | }).then(res => { | 66 | }).then(res => { | 
| 67 | if(res.data.code==0 && res.data.data){ | 67 | if(res.data.code==0 && res.data.data){ | 
| 68 | var item=res.data.data[0]; | 68 | var item=res.data.data[0]; | 
| 69 | - th.setData({ad_img:item.ad_code}) | 69 | + if (item && item.ad_code) | 
| 70 | + th.setData({ad_img:item.ad_code}) | ||
| 70 | } | 71 | } | 
| 71 | }) | 72 | }) | 
| 72 | }, | 73 | }, | 
