Authored by 姜枫

Merge branch 'release/2.0' into 'master'

fix bug & 百度统计



See merge request !5
... ... @@ -83,7 +83,7 @@ const favorite = {
p.stateText = '已售罄';
p.hideBtn = true;
}
p.url = `/product/pro_${p.productId}_${p.goodsId}/${p.cnAlphabet}.html`;
p.url = `/product/pro_${p.product_id}_${p.goodsId}/${p.cnAlphabet}.html`;
p.imageUrl = p.image.replace('imageMogr2', 'imageMogr1');
});
... ...
... ... @@ -316,14 +316,12 @@ const local = {
*/
const wechat = {
login: (req, res, next) => {
req.session = req.session || {};
req.session.authState = uuid.v4();
return passport.authenticate('wechat', {
state: req.session.authState
state: uuid.v4()
})(req, res, next);
},
callback: (req, res, next) => {
if (req.session && req.session.authState && req.session.authState === req.query.state) {
if (req.session) {
passport.authenticate('wechat', (err, user) => {
if (err) {
log.error(`wechat authenticate error : ${JSON.stringify(err)}`);
... ... @@ -349,7 +347,6 @@ const wechat = {
*/
const sina = {
login: (req, res, next) => {
req.session = req.session || {};
req.session.authState = uuid.v4();
return passport.authenticate('sina', {
state: req.session.authState
... ...
... ... @@ -74,7 +74,7 @@ const signinByWechatAsync = (nickname, openId, sourceType, shoppingKey, unionId)
openId: openId,
unionId: unionId,
source_type: sourceType,
method: 'app.passport.signinByWechat'
method: 'app.passport.signinByOpenID'
};
if (shoppingKey) {
... ...
<script>
(function(w, d, s, j, f) {
var a = d.createElement(s);
var m = d.getElementsByTagName(s)[0];
w.YohoAcquisitionObject = f;
w[f] = function() {
w[f].p = arguments;
};
a.async = 1;
a.src = j;
m.parentNode.insertBefore(a, m);
}(window, document, 'script', (document.location.protocol === 'https:' ? 'https' : 'http') + '://cdn.yoho.cn/yas-jssdk/1.0.17/yas.js', 'yohoblk_web'));
</script>
\ No newline at end of file
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?aa0a2539863efdcb816742ac181a59ac";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
... ...