Merge branch 'hotfix/wechathttps' into hotfix/address
Showing
5 changed files
with
11 additions
and
10 deletions
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | * @Author: Targaryen | 2 | * @Author: Targaryen |
3 | * @Date: 2017-01-03 17:42:41 | 3 | * @Date: 2017-01-03 17:42:41 |
4 | * @Last Modified by: Targaryen | 4 | * @Last Modified by: Targaryen |
5 | - * @Last Modified time: 2017-02-27 16:34:09 | 5 | + * @Last Modified time: 2017-03-01 09:54:23 |
6 | */ | 6 | */ |
7 | 7 | ||
8 | 'use strict'; | 8 | 'use strict'; |
@@ -148,7 +148,8 @@ const Wechat = { | @@ -148,7 +148,8 @@ const Wechat = { | ||
148 | */ | 148 | */ |
149 | getOpenid(code, originalUrl) { | 149 | getOpenid(code, originalUrl) { |
150 | if (!code) { | 150 | if (!code) { |
151 | - let baseUrl = 'http://m.yohobuy.com' + originalUrl; | 151 | + let isProduction = process.env.NODE_ENV === 'production'; |
152 | + let baseUrl = isProduction ? 'https://m.yohobuy.com' : 'http://m.yohobuy.com' + originalUrl; | ||
152 | let redirectUrl = tools.createOauthUrlForCode(baseUrl); | 153 | let redirectUrl = tools.createOauthUrlForCode(baseUrl); |
153 | 154 | ||
154 | logger.info('payCenter: wechat pay no code'); | 155 | logger.info('payCenter: wechat pay no code'); |
@@ -6,7 +6,7 @@ var phone, | @@ -6,7 +6,7 @@ var phone, | ||
6 | newUserCouponPic = $('#newUserCouponPic').html(), | 6 | newUserCouponPic = $('#newUserCouponPic').html(), |
7 | tipMessage = $('#tipMessage').html(), | 7 | tipMessage = $('#tipMessage').html(), |
8 | activityID = $('#activityID').html(), | 8 | activityID = $('#activityID').html(), |
9 | - _weChatInterface = '//m.yohobuy.com/life/getSignPackage', | 9 | + _weChatInterface = '//m.yohobuy.com/activity/wechat/share', |
10 | shareTitle = $('#shareTitle').val(), | 10 | shareTitle = $('#shareTitle').val(), |
11 | shareImg = $('#shareImg').val(), | 11 | shareImg = $('#shareImg').val(), |
12 | shareDesc = $('#shareDesc').val(), | 12 | shareDesc = $('#shareDesc').val(), |
@@ -53,7 +53,7 @@ if (!$('#newUser').html()) { | @@ -53,7 +53,7 @@ if (!$('#newUser').html()) { | ||
53 | * 微信分享 | 53 | * 微信分享 |
54 | */ | 54 | */ |
55 | if (typeof wx !== 'undefined') { | 55 | if (typeof wx !== 'undefined') { |
56 | - $.getJSON(_weChatInterface + '?pageurl=' + | 56 | + $.getJSON(_weChatInterface + '?url=' + |
57 | encodeURIComponent(location.href.split('#')[0]) + '&callback=?', | 57 | encodeURIComponent(location.href.split('#')[0]) + '&callback=?', |
58 | function(json) { | 58 | function(json) { |
59 | var _appId, _timestamp, _nonceStr, _signature; | 59 | var _appId, _timestamp, _nonceStr, _signature; |
1 | // 初始化config信息 | 1 | // 初始化config信息 |
2 | -var _weChatInterface = 'http://www.yohoboys.com/api/wechat/getSignPackage';// 签名等相关配置,yoho公众号 | 2 | +var _weChatInterface = '//m.yohobuy.com/activity/wechat/share';// 签名等相关配置,yoho公众号 |
3 | 3 | ||
4 | -$.getJSON(_weChatInterface + '?pageurl=' + encodeURIComponent(location.href.split('#')[0]) + '&callback=?', function(json) { | 4 | +$.getJSON(_weChatInterface + '?url=' + encodeURIComponent(location.href.split('#')[0]) + '&callback=?', function(json) { |
5 | if (json !== undefined && json !== '') { | 5 | if (json !== undefined && json !== '') { |
6 | var _appId = json.appId.toString(); | 6 | var _appId = json.appId.toString(); |
7 | var _timestamp = json.timestamp; | 7 | var _timestamp = json.timestamp; |
@@ -6,7 +6,7 @@ var $ = require('yoho-jquery'), | @@ -6,7 +6,7 @@ var $ = require('yoho-jquery'), | ||
6 | dialog = require('../plugin/dialog'), | 6 | dialog = require('../plugin/dialog'), |
7 | Hammer = require('yoho-hammer'); | 7 | Hammer = require('yoho-hammer'); |
8 | 8 | ||
9 | -var _weChatInterface = '//m.yohobuy.com/life/getSignPackage', | 9 | +var _weChatInterface = '//m.yohobuy.com/activity/wechat/share', |
10 | wx = window.wx, | 10 | wx = window.wx, |
11 | C_ID, | 11 | C_ID, |
12 | getChannel; | 12 | getChannel; |
@@ -159,7 +159,7 @@ $('.on-lingqu', 'div.main-right-use').on('click', function() { | @@ -159,7 +159,7 @@ $('.on-lingqu', 'div.main-right-use').on('click', function() { | ||
159 | * 微信分享 | 159 | * 微信分享 |
160 | */ | 160 | */ |
161 | if (typeof wx !== 'undefined') { | 161 | if (typeof wx !== 'undefined') { |
162 | - $.getJSON(_weChatInterface + '?pageurl=' + | 162 | + $.getJSON(_weChatInterface + '?url=' + |
163 | encodeURIComponent(location.href.split('#')[0]) + '&callback=?', | 163 | encodeURIComponent(location.href.split('#')[0]) + '&callback=?', |
164 | function(json) { | 164 | function(json) { |
165 | var _appId, | 165 | var _appId, |
@@ -6,7 +6,7 @@ var $ = require('yoho-jquery'), | @@ -6,7 +6,7 @@ var $ = require('yoho-jquery'), | ||
6 | dialog = require('../plugin/dialog'), | 6 | dialog = require('../plugin/dialog'), |
7 | Hammer = require('yoho-hammer'); | 7 | Hammer = require('yoho-hammer'); |
8 | 8 | ||
9 | -var _weChatInterface = '//m.yohobuy.com/life/getSignPackage', | 9 | +var _weChatInterface = '//m.yohobuy.com/activity/wechat/share', |
10 | wx = window.wx, | 10 | wx = window.wx, |
11 | C_ID, | 11 | C_ID, |
12 | getChannel; | 12 | getChannel; |
@@ -155,7 +155,7 @@ $('.on-lingqu', 'div.main-right-use').on('click', function() { | @@ -155,7 +155,7 @@ $('.on-lingqu', 'div.main-right-use').on('click', function() { | ||
155 | * 微信分享 | 155 | * 微信分享 |
156 | */ | 156 | */ |
157 | if (typeof wx !== 'undefined') { | 157 | if (typeof wx !== 'undefined') { |
158 | - $.getJSON(_weChatInterface + '?pageurl=' + | 158 | + $.getJSON(_weChatInterface + '?url=' + |
159 | encodeURIComponent(location.href.split('#')[0]) + '&callback=?', | 159 | encodeURIComponent(location.href.split('#')[0]) + '&callback=?', |
160 | function(json) { | 160 | function(json) { |
161 | var _appId, | 161 | var _appId, |
-
Please register or login to post a comment