Authored by yyq

Merge branch 'release/1.0' of git.yoho.cn:fe/yoho-blk into release/1.0

... ... @@ -34,7 +34,10 @@ const _doPassportCallback = (req, res, user) => {
if (user.openId && user.nickname) {
let signinByOpenID = LoginService.signinByOpenIDAsync(
user.nickname, user.openId, user.sourceType, shoppingKey, user.unionId);
_.trim(user.nickname), _.trim(user.openId),
_.trim(user.sourceType), _.trim(shoppingKey),
_.trim(user.unionId)
);
return signinByOpenID.then((result) => {
if (result.code !== 200) {
... ...
... ... @@ -44,11 +44,11 @@ exports.lte = (num1, num2, options) => {
* @return {[boolen]}
*/
exports.showStorage = (leftNumber) => {
leftNumber = typeof num1 === 'number' ? leftNumber : parseFloat(leftNumber, 10);
leftNumber = +leftNumber;
if (leftNumber <= 3 && leftNumber >= 0) {
if (leftNumber <= 3 && leftNumber > 0) {
return `仅剩${leftNumber}件`;
} else if (leftNumber < 0) {
} else if (leftNumber <= 0) {
return '库存不足';
}
};
... ...
... ... @@ -22,7 +22,7 @@ exports.notFound = () => {
});
}
return res.display('error/404', {
return res.status(404).display('error/404', {
module: 'common',
page: 'error',
title: '页面不存在 | Yoho!BLK | 潮流购物逛不停'
... ... @@ -50,7 +50,7 @@ exports.serverError = () => {
}
renderErrPage = (result) => {
res.display('error/500', {
res.status(500).display('error/500', {
module: 'common',
page: 'error',
err: err,
... ...
... ... @@ -4,11 +4,11 @@
* @return {[boolen]}
*/
module.exports = function(leftNumber) {
leftNumber = typeof num1 === 'number' ? leftNumber : parseFloat(leftNumber, 10);
leftNumber = +leftNumber;
if (leftNumber <= 3 && leftNumber >= 0) {
if (leftNumber <= 3 && leftNumber > 0) {
return '仅剩' + leftNumber + '件';
} else if (leftNumber < 0) {
} else if (leftNumber <= 0) {
return '库存不足';
}
};
... ...
/* eslint-disable */
/**
* Created by TaoHuang on 2016/7/29.
*/
... ...