From dd939433b0998f476ab9da20b31953c47f850c21 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 12 Sep 2019 10:49:22 +0800 Subject: [PATCH] protocol --- public/react/src/App.js | 14 ++++++++++++++ public/react/src/common/util/ShareUtil.js | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/public/react/src/App.js b/public/react/src/App.js index 1a4aedc05..17ee34255 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -326,6 +326,20 @@ class App extends Component { }); wx.ready(function () { console.log('wx is ready') + // var shareData = { + // title: 'EduCoder - 首页', + // desc: 'Educoder是一个面向计算机类的互联网IT教育和实战平台,提供企业级工程实训,以实现工程化专业教学的自动化和智能化。高校和企业人员可以在此开展计算机实践性教学活动,将传统的知识传授和时兴的工程实战一体化。', + // link: currentUrl, + // imgUrl: window.__testImageUrl + // || (currentUrl.endsWith('/') ? currentUrl : currentUrl + '/') + 'react/build/images/share_logo_icon.jpg' + // }; + + // wx.onMenuShareAppMessage(shareData);//分享给好友 + // wx.onMenuShareTimeline(shareData);//分享到朋友圈 + // wx.onMenuShareQQ(shareData);//分享给手机QQ + // wx.onMenuShareWeibo(shareData);//分享腾讯微博 + // wx.onMenuShareQZone(shareData);//分享到QQ空间 + configShareForIndex('/') }); wx.error(function (res) { diff --git a/public/react/src/common/util/ShareUtil.js b/public/react/src/common/util/ShareUtil.js index 24fffbf15..c4ec8a62a 100644 --- a/public/react/src/common/util/ShareUtil.js +++ b/public/react/src/common/util/ShareUtil.js @@ -1,4 +1,4 @@ -const host = window.location.host +const host = window.location.protocol + '//' + window.location.host const wx = window.wx function share(shareData) { try {