Merge branch 'release/1.0' of git.yoho.cn:fe/yoho-blk into release/1.0
Showing
5 changed files
with
13 additions
and
9 deletions
@@ -34,7 +34,10 @@ const _doPassportCallback = (req, res, user) => { | @@ -34,7 +34,10 @@ const _doPassportCallback = (req, res, user) => { | ||
34 | 34 | ||
35 | if (user.openId && user.nickname) { | 35 | if (user.openId && user.nickname) { |
36 | let signinByOpenID = LoginService.signinByOpenIDAsync( | 36 | let signinByOpenID = LoginService.signinByOpenIDAsync( |
37 | - user.nickname, user.openId, user.sourceType, shoppingKey, user.unionId); | 37 | + _.trim(user.nickname), _.trim(user.openId), |
38 | + _.trim(user.sourceType), _.trim(shoppingKey), | ||
39 | + _.trim(user.unionId) | ||
40 | + ); | ||
38 | 41 | ||
39 | return signinByOpenID.then((result) => { | 42 | return signinByOpenID.then((result) => { |
40 | if (result.code !== 200) { | 43 | if (result.code !== 200) { |
@@ -44,11 +44,11 @@ exports.lte = (num1, num2, options) => { | @@ -44,11 +44,11 @@ exports.lte = (num1, num2, options) => { | ||
44 | * @return {[boolen]} | 44 | * @return {[boolen]} |
45 | */ | 45 | */ |
46 | exports.showStorage = (leftNumber) => { | 46 | exports.showStorage = (leftNumber) => { |
47 | - leftNumber = typeof num1 === 'number' ? leftNumber : parseFloat(leftNumber, 10); | 47 | + leftNumber = +leftNumber; |
48 | 48 | ||
49 | - if (leftNumber <= 3 && leftNumber >= 0) { | 49 | + if (leftNumber <= 3 && leftNumber > 0) { |
50 | return `仅剩${leftNumber}件`; | 50 | return `仅剩${leftNumber}件`; |
51 | - } else if (leftNumber < 0) { | 51 | + } else if (leftNumber <= 0) { |
52 | return '库存不足'; | 52 | return '库存不足'; |
53 | } | 53 | } |
54 | }; | 54 | }; |
@@ -22,7 +22,7 @@ exports.notFound = () => { | @@ -22,7 +22,7 @@ exports.notFound = () => { | ||
22 | }); | 22 | }); |
23 | } | 23 | } |
24 | 24 | ||
25 | - return res.display('error/404', { | 25 | + return res.status(404).display('error/404', { |
26 | module: 'common', | 26 | module: 'common', |
27 | page: 'error', | 27 | page: 'error', |
28 | title: '页面不存在 | Yoho!BLK | 潮流购物逛不停' | 28 | title: '页面不存在 | Yoho!BLK | 潮流购物逛不停' |
@@ -50,7 +50,7 @@ exports.serverError = () => { | @@ -50,7 +50,7 @@ exports.serverError = () => { | ||
50 | } | 50 | } |
51 | 51 | ||
52 | renderErrPage = (result) => { | 52 | renderErrPage = (result) => { |
53 | - res.display('error/500', { | 53 | + res.status(500).display('error/500', { |
54 | module: 'common', | 54 | module: 'common', |
55 | page: 'error', | 55 | page: 'error', |
56 | err: err, | 56 | err: err, |
@@ -4,11 +4,11 @@ | @@ -4,11 +4,11 @@ | ||
4 | * @return {[boolen]} | 4 | * @return {[boolen]} |
5 | */ | 5 | */ |
6 | module.exports = function(leftNumber) { | 6 | module.exports = function(leftNumber) { |
7 | - leftNumber = typeof num1 === 'number' ? leftNumber : parseFloat(leftNumber, 10); | 7 | + leftNumber = +leftNumber; |
8 | 8 | ||
9 | - if (leftNumber <= 3 && leftNumber >= 0) { | 9 | + if (leftNumber <= 3 && leftNumber > 0) { |
10 | return '仅剩' + leftNumber + '件'; | 10 | return '仅剩' + leftNumber + '件'; |
11 | - } else if (leftNumber < 0) { | 11 | + } else if (leftNumber <= 0) { |
12 | return '库存不足'; | 12 | return '库存不足'; |
13 | } | 13 | } |
14 | }; | 14 | }; |
-
Please register or login to post a comment