Authored by 毕凯

Merge remote-tracking branch 'origin/master' into feature/qps

... ... @@ -129,7 +129,7 @@ const tools = {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: xml,
timeout: 1000
timeout: 5000
};
return co(function* () {
... ...
... ... @@ -35,7 +35,7 @@ exports.orderDetailData = (req, res, next) => {
let refundReason = result[2];
if (!orderDetail || _.isEmpty(orderDetail)) {
return next(404);
return next();
}
Object.assign(orderDetail, {
... ...
... ... @@ -81,11 +81,11 @@ class BackNew {
/**
* 通过邮箱找回密码成功页
*/
backByEmailSuccess(req, res) {
backByEmailSuccess(req, res, next) {
let email = req.query.email || '';
if (!helpers.verifyEmail(email)) {
res.redirect(400);
return next();
}
res.render('back/email-success-new', {
width750: true,
... ...
... ... @@ -23,6 +23,7 @@ const thirdAccount = require('../data/third-account.json');
const auth = require('../models/auth-helper');
const loginPage = `${config.siteUrl}/signin.html`;
const FROM = require('../../../config/from');
function doPassportCallback(openId, nickname, sourceType, req, res) {
let shoppingKey = cookie.getShoppingKey(req);
... ... @@ -152,7 +153,7 @@ const common = {
let from = req.query.from;
if (from) {
if (from && FROM[from]) {
res.cookie('from', from, {
domain: 'yohobuy.com',
expires: new Date(Date.now() + 10 * 60 * 1000)
... ...
... ... @@ -114,7 +114,7 @@ class SmsLogin {
if (!req.xhr || step !== 2) {
return next(404);
return next();
}
let now = Date.now();
... ... @@ -182,7 +182,7 @@ class SmsLogin {
let step = _.get(req.session, 'smsLogin.step');
if (!req.xhr && step !== 2) {
return next(404);
return next();
}
if (!code) {
... ...
... ... @@ -11,8 +11,8 @@ const isProduction = process.env.NODE_ENV === 'production';
const isTest = process.env.NODE_ENV === 'test';
const domains = {
api: 'http://api.yoho.cn/',
service: 'http://service.yoho.cn/',
api: 'http://api.yoho.yohoops.org/',
service: 'http://service.yoho.yohoops.org/',
liveApi: 'http://testapi.live.yohops.com:9999/',
singleApi: 'http://api-test3.yohops.com:9999/',
imSocket: 'ws://socket.yohobuy.com:10240',
... ...
... ... @@ -23,11 +23,11 @@
{{/dnsPrefetch.hosts}}
<script>
{{#ifand isProduction wap.open.bughd}}
window._timeStart = new Date().getTime();
window._yohoAppName = 'yohobuywap-node';
{{#ifand isProduction wap.open.bughd}}
!function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")});var n=r(13),i=r(14);n.init(),i.init()},function(e,t){e.exports=function(e,t,r){if("undefined"==typeof t){var n=null;if(document.cookie)for(var i=document.cookie.split(";"),o=0;o<i.length;o++){var a=(i[o]||"").trim();if(a.substring(0,e.length+1)==e+"="){n=decodeURIComponent(a.substring(e.length+1));break}}return n}r=r||{},null===t&&(t="",r.expires=-1);var d="";if(r.expires&&("number"==typeof r.expires||r.expires.toUTCString)){var s;"number"==typeof r.expires?(s=new Date,s.setTime(s.getTime()+24*r.expires*60*60*1e3)):s=r.expires,d="; expires="+s.toUTCString()}var u=r.path?"; path="+r.path:"",p=r.domain?"; domain="+r.domain:"",c=r.secure?"; secure":"";document.cookie=[e,"=",encodeURIComponent(t),d,u,p,c].join("")}},,function(e,t,r){var n=r(1),i=window._yohoAppName||"unknown",o={config:{reportUrl:"//badjs.yoho.cn/apm/yas.gif"},stringify:function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r],i=[];for(var o in n)n.hasOwnProperty(o)&&i.push(o+"::"+n[o]);t.push(i.join("$$"))}return t.join("**")},report:function(e,t){if(e){var r=new Image;r.src=this.config.reportUrl+"?s="+i+"&l="+e+"&t="+(new Date).getTime(),t&&t()}},getUdid:function(){var e=(n("yohobuy_session")||"").slice(2).split(".")[0];return e||0},getUid:function(){var e=(n("_UID")||"").split("::")[1];return e||0},getReqId:function(){return n("docreqid")||0}};e.exports=o},,,,,,,,,,function(e,t,r){var n=r(1),i=r(3),o="_errLog",a={writeError:function(e,t,r,a,d){var s=JSON.parse(n(o)||"[]");s.push({tp:"err",msg:e,sc:t,ln:r,cn:a,pt:location.href,u:i.getUid(),ud:i.getUdid(),rid:i.getReqId(),st:JSON.stringify(d&&d.stack)}),n(o,JSON.stringify(s)),s.length>=5&&this.reportError()},clearError:function(){n(o,"[]")},reportError:function(){var e=this,t=JSON.parse(n(o)||"[]"),r=i.stringify(t);i.report(r,function(){e.clearError()})},init:function(){var e=this;window.onerror=function(t,r,n,i,o){e.writeError(t,r,n,i,o)},this.reportError()}};e.exports=a},function(e,t,r){function n(e){var t=e.offsetTop;return null!==e.offsetParent&&(t+=n(e.offsetParent)),t}var i=r(3),o=window.screen.height,a=[],d=!1,s=!1,u=0,p=setInterval(function(){var e,t;if(d){if(a.length)for(e=0;e<a.length;e++){if(t=a[e],!t.complete){s=!1;break}s=!0}else s=!0;s&&(u=(new Date).getTime()-_timeStart,clearInterval(p))}else{var r=document.body.querySelector("img")||[];for(e=0;e<r.length;e++){t=r[e];var i=n(t);if(i>o){d=!0;break}i<=o&&!t.hasPushed&&(t.hasPushed=1,a.push(t))}}},0),c={reportTime:function(e){var t=i.stringify(e);i.report(t)},addEvent:function(){var e=this,t=[],r=location.href,n=i.getUid(),o=i.getUdid(),a=i.getReqId(),c=window.performance&&window.performance.timing.navigationStart||0;_timeStart=window._timeStart||0,document.addEventListener&&document.addEventListener("DOMContentLoaded",function(e){t.push({tp:"dcl",t:(new Date).getTime()-_timeStart,pt:r,u:n,ud:o,rid:a});var i=document.body.querySelector("img")||[];i.length||(d=!0)},!1),window.addEventListener&&window.addEventListener("load",function(i){t.push({tp:"ld",t:(new Date).getTime()-_timeStart,pt:r,u:n,ud:o,rid:a}),s=!0,d=!0,p&&clearInterval(p),u&&t.push({tp:"fs",t:u,pt:r,u:n,ud:o,rid:a}),t.push({tp:"pf",dcl:(window.performance&&window.performance.timing.domComplete||0)-c,ld:(window.performance&&window.performance.timing.loadEventStart||0)-c,pt:r,u:n,ud:o,rid:a}),e.reportTime(t)},!1)},init:function(){this.addEvent()}};e.exports=c}]);
!function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")});var n=r(13),i=r(14);n.init(),i.init()},function(e,t){e.exports=function(e,t,r){if("undefined"==typeof t){var n=null;if(document.cookie)for(var i=document.cookie.split(";"),o=0;o<i.length;o++){var a=(i[o]||"").trim();if(a.substring(0,e.length+1)==e+"="){n=decodeURIComponent(a.substring(e.length+1));break}}return n}r=r||{},null===t&&(t="",r.expires=-1);var d="";if(r.expires&&("number"==typeof r.expires||r.expires.toUTCString)){var u;"number"==typeof r.expires?(u=new Date,u.setTime(u.getTime()+24*r.expires*60*60*1e3)):u=r.expires,d="; expires="+u.toUTCString()}var s=r.path?"; path="+r.path:"",p=r.domain?"; domain="+r.domain:"",c=r.secure?"; secure":"";document.cookie=[e,"=",encodeURIComponent(t),d,s,p,c].join("")}},,function(e,t,r){var n=r(1),i=window._yohoAppName||"unknown",o={config:{reportUrl:"//badjs.yoho.cn/apm/yas.gif"},stringify:function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r],i=[];for(var o in n)n.hasOwnProperty(o)&&i.push(o+"::"+n[o]);t.push(i.join("$$"))}return t.join("**")},report:function(e,t){if(e){var r=new Image;r.src=this.config.reportUrl+"?s="+i+"&l="+e+"&t="+(new Date).getTime(),t&&t()}},getUdid:function(){var e=(n("yohobuy_session")||"").slice(2).split(".")[0];return e||0},getUid:function(){var e=(n("_UID")||"").split("::")[1];return e||0},getReqId:function(){return n("docreqid")||0}};e.exports=o},,,,,,,,,,function(e,t,r){var n=r(1),i=r(3),o="_errLog",a={writeError:function(e,t,r,a,d){var u=JSON.parse(n(o)||"[]");u.push({tp:"err",msg:e,sc:t,ln:r,cn:a,pt:location.href,u:i.getUid(),ud:i.getUdid(),rid:i.getReqId(),st:JSON.stringify(d&&d.stack)}),n(o,JSON.stringify(u)),u.length>=5&&this.reportError()},clearError:function(){n(o,"[]")},reportError:function(){var e=this,t=JSON.parse(n(o)||"[]"),r=i.stringify(t);i.report(r,function(){e.clearError()})},init:function(){var e=this;window.onerror=function(t,r,n,i,o){e.writeError(t,r,n,i,o)},this.reportError()}};e.exports=a},function(e,t,r){function n(e){var t=e.offsetTop;return null!==e.offsetParent&&(t+=n(e.offsetParent)),t}var i=r(3),o=window.screen.height,a=[],d=!1,u=!1,s=0,p=setInterval(function(){var e,t;if(d){if(a.length)for(e=0;e<a.length;e++){if(t=a[e],!t.complete){u=!1;break}u=!0}else u=!0;u&&(s=(new Date).getTime()-_timeStart,clearInterval(p))}else{var r=document.body&&document.body.querySelectorAll("img")||[];for(e=0;e<r.length;e++){t=r[e];var i=n(t);if(i>o){d=!0;break}i<=o&&!t.hasPushed&&(t.hasPushed=1,a.push(t))}}},0),c={reportTime:function(e){var t=i.stringify(e);i.report(t)},addEvent:function(){var e=this,t=[],r=location.href,n=i.getUid(),o=i.getUdid(),a=i.getReqId(),c=window.performance&&window.performance.timing.navigationStart||0;_timeStart=window._timeStart||0,document.addEventListener&&document.addEventListener("DOMContentLoaded",function(e){t.push({tp:"dcl",t:(new Date).getTime()-_timeStart,pt:r,u:n,ud:o,rid:a});var i=document.body&&document.body.querySelectorAll("img")||[];i.length||(d=!0)},!1),window.addEventListener&&window.addEventListener("load",function(i){t.push({tp:"ld",t:(new Date).getTime()-_timeStart,pt:r,u:n,ud:o,rid:a}),u=!0,d=!0,p&&clearInterval(p),s&&t.push({tp:"fs",t:s,pt:r,u:n,ud:o,rid:a}),t.push({tp:"pf",dcl:(window.performance&&window.performance.timing.domComplete||0)-c,ld:(window.performance&&window.performance.timing.loadEventStart||0)-c,pt:r,u:n,ud:o,rid:a}),e.reportTime(t)},!1)},init:function(){this.addEvent()}};e.exports=c}]);
{{/ifand}}
</script>
... ...
... ... @@ -73,7 +73,7 @@
"xml2js": "^0.4.19",
"yoho-express-session": "^2.0.0",
"yoho-md5": "^2.0.0",
"yoho-node-lib": "=0.5.5",
"yoho-node-lib": "=0.5.7",
"yoho-zookeeper": "^1.0.8"
},
"devDependencies": {
... ...
... ... @@ -347,7 +347,7 @@ function coupon(count, orderInfo, orderComputeData) {
info: ''
};
let couponAmount = _.get(orderComputeData, 'coupon_amount', false);
let couponAmount = _.get(orderComputeData, 'coupon_amount', 0);
if (_.get(orderInfo, 'usable_usual_code', null)) {
coupons.selectedAmount++;
... ...
... ... @@ -335,7 +335,7 @@ const pushGoodsInfo = (decorators, goodsList) => {
decorators[key].noShowProductInfo = true;
}
if (subValue.skn && hasGoods) {
if (subValue.skn && hasGoods && value.module_type !== 'CarouselImage') {
let salesPrice = _.get(goodsObj, `${subValue.skn}.sales_price`, '');
let marketPrice = _.get(goodsObj, `${subValue.skn}.market_price`, '');
let imageSrc = _.get(goodsObj, `${subValue.skn}.default_images`, '');
... ...