|
@@ -30,7 +30,7 @@ var http = {
|
|
|
var self = this;
|
|
|
if (vue == 'post') {
|
|
|
config.request.method = 'POST';
|
|
|
- config.request.method = 'GET';
|
|
|
+ //config.request.method = 'GET';
|
|
|
vue = false;
|
|
|
} else {
|
|
|
config.request.method = 'GET';
|
|
@@ -630,8 +630,12 @@ var share =
|
|
|
var self = this;
|
|
|
self.wx = wx;
|
|
|
self.wechat = dever.is_weixin();
|
|
|
- self.project = project;
|
|
|
- self.url = host;
|
|
|
+ self.project = project;
|
|
|
+ self.url = host;
|
|
|
+ if (!host) {
|
|
|
+ self.url = config.share.host;
|
|
|
+ }
|
|
|
+
|
|
|
self.token = http.getToken();
|
|
|
self.param = param;
|
|
|
self.param.timelineCallback = function() {};
|
|
@@ -655,10 +659,9 @@ var share =
|
|
|
options.url = location.href.split('#')[0];
|
|
|
options.noloading = 1;
|
|
|
options.token = this.token;
|
|
|
- http.request('post', url, options, function(result) {
|
|
|
- var data = result.data;
|
|
|
- self.wx.config({
|
|
|
- //debug:true,
|
|
|
+ http.request('post', url, options, function(data) {
|
|
|
+ self.wx.config({
|
|
|
+ debug:true,
|
|
|
appId: data.appId,
|
|
|
timestamp: data.timestamp,
|
|
|
nonceStr: data.nonceStr,
|
|
@@ -677,15 +680,12 @@ var share =
|
|
|
link: param.link,
|
|
|
imgUrl: param.pic,
|
|
|
success: function(res) {
|
|
|
- param.sendMessageCallback('success', res)
|
|
|
self.shareLog(1, 1);
|
|
|
},
|
|
|
cancel: function(res) {
|
|
|
- param.sendMessageCallback('cancel', res)
|
|
|
self.shareLog(1, 2);
|
|
|
},
|
|
|
fail: function(res) {
|
|
|
- param.sendMessageCallback('fail', res)
|
|
|
self.shareLog(1, 3);
|
|
|
}
|
|
|
});
|
|
@@ -694,15 +694,12 @@ var share =
|
|
|
link: param.url,
|
|
|
imgUrl: param.img,
|
|
|
success: function(res) {
|
|
|
- param.timelineCallback('success', res)
|
|
|
self.shareLog(2, 1);
|
|
|
},
|
|
|
cancel: function(res) {
|
|
|
- param.timelineCallback('cancel', res)
|
|
|
self.shareLog(2, 2);
|
|
|
},
|
|
|
fail: function(res) {
|
|
|
- param.timelineCallback('fail', res)
|
|
|
self.shareLog(2, 3);
|
|
|
}
|
|
|
});
|
|
@@ -711,15 +708,12 @@ var share =
|
|
|
link: param.url,
|
|
|
imgUrl: param.img,
|
|
|
success: function(res) {
|
|
|
- param.shareQQCallback('success', res)
|
|
|
self.shareLog(3, 1);
|
|
|
},
|
|
|
cancel: function(res) {
|
|
|
- param.shareQQCallback('cancel', res)
|
|
|
self.shareLog(3, 2);
|
|
|
},
|
|
|
fail: function(res) {
|
|
|
- param.shareQQCallback('fail', res)
|
|
|
self.shareLog(3, 3);
|
|
|
}
|
|
|
});
|