From 0170247b4a85705e0d744ef7401e1d86a9f2a866 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 6 Sep 2019 14:09:23 +0800 Subject: [PATCH] currentUrl --- public/react/src/App.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/public/react/src/App.js b/public/react/src/App.js index 087323521..3013eca7b 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -285,8 +285,9 @@ class App extends Component { if (window.wx) { const wx = window.wx const url = '/wechats/js_sdk_signature.json' + const currentUrl = window.location.href.split('#')[0] axios.post(url, { - url: window.location.href.split('#')[0], + url: currentUrl, }).then((response) => { console.log('got res') const data = response.data; @@ -308,10 +309,10 @@ class App extends Component { wx.ready(function () { console.log('wx is ready') var shareData = { - title: '这是是分享标题', - desc: '这是是摘要', - link: 'http://pre-newweb.educoder.net', - imgUrl: 'http://pre-newweb.educoder.net/images/educoder/index/subject/subject15.jpg' + title: 'EduCoder', + desc: '创新源于实践', + link: currentUrl, + imgUrl: currentUrl + '/images/educoder/index/subject/subject15.jpg' }; wx.onMenuShareAppMessage(shareData);//分享给好友