Authored by 毕凯

Merge branch 'release/4.6' of git.yoho.cn:fe/yohobuy-node into release/4.6

... ... @@ -2,15 +2,26 @@
* 404 错误
* @return {[type]}
*/
const headerModel = require('../models/header');
exports.notFound = () => {
return (req, res) => {
if (req.xhr) {
return res.status(404).json({
code: 404,
message: '页面不存在'
message: '抱歉,页面不存在!'
});
}
return res.render('error/404');
headerModel.requestHeaderData().then((result) => {
return res.render('error/404', {
module: 'common',
page: 'error',
title: '页面不存在 | Yoho!Buy有货 | 潮流购物逛不停',
headerData: result.headerData
});
});
};
};
... ... @@ -24,11 +35,19 @@ exports.serverError = () => {
if (req.xhr) {
return res.status(500).json({
code: 500,
message: '服务器错误'
message: '服务器错误'
});
}
return res.render('error/500', err);
headerModel.requestHeaderData().then((result) => {
return res.render('error/500', {
module: 'common',
page: 'error',
err: err,
title: '服务器错误 | Yoho!Buy有货 | 潮流购物逛不停',
headerData: result.headerData
});
});
}
next(err);
};
... ...
... ... @@ -186,7 +186,6 @@ const setHeaderData = (resData, type) => {
subNav: resData ? getSubNav(resData, type) : []
}
};
return data;
};
... ...
404
<div class="wrapper screen">
<div class="clear wrapper-404">
<div class="left"><img src="http://static.yohobuy.com/images/v3/index/404.png"></div>
<div class="right right-tips">
<p class="text1">很抱歉,您访问的页面不存在!</p>
<p class="text2">
</p>
<p class="text3"><a href="http://www.yohobuy.com/product/new" class="button">浏览新品</a>&nbsp;&nbsp;<a href="http://www.yohobuy.com/" class="button">返回首页</a></p>
</div>
</div>
</div>
\ No newline at end of file
... ...
500
<div class="wrapper screen">
<div class="clear wrapper-404">
<div class="left"><img src="http://static.yohobuy.com/images/v3/index/404.png"></div>
<div class="right right-tips">
<p class="text1">服务器错误!</p>
<p class="text2">
</p>
<p class="text3"><a href="http://www.yohobuy.com/product/new" class="button">浏览新品</a>&nbsp;&nbsp;<a href="http://www.yohobuy.com/" class="button">返回首页</a></p>
</div>
</div>
</div>
\ No newline at end of file
... ...
<div class="wrapper-404">
<div class="main-error">
<div class="left">
<img src="http://static.yohobuy.com/images/v3/index/404.png">
</div>
<div class="right">
<p class="text1">很抱歉,您访问的页面不存在!</p>
<p class="text2"></p>
<p class="text3">
<a href="http://www.yohobuy.com/product/new">浏览新品</a>&nbsp;&nbsp;
<a href="http://www.yohobuy.com/">返回首页</a>
</p>
</div>
</div>
</div>
require('../common');
... ...
.wrapper-404 {
width: 560px;
margin: 80px auto;
min-height: 240px;
.text1 {
font-size: 24px;
margin-top: 60px;
line-height: 24px;
}
.text2 {
margin: 18px 0 10px;
line-height: 12px;
}
.text3 .button-2 {
height: 24px;
line-height: 24px;
font-size: 12px;
color: #fff;
margin-right: 5px;
}
}
... ...
... ... @@ -192,3 +192,4 @@
@import "404";
@import "path-nav";
@import "floor-header";
@import "error";
... ...