lrf402788946 4 vuotta sitten
vanhempi
commit
82ffe1ddda
1 muutettua tiedostoa jossa 7 lisäystä ja 5 poistoa
  1. 7 5
      src/router/index.js

+ 7 - 5
src/router/index.js

@@ -115,6 +115,9 @@ router.beforeEach(async (to, form, next) => {
 });
 
 router.afterEach(async (to, form) => {
+  const title = to.meta.title;
+  const img = 'http://broadcast.waityou24.cn/files/article/icon.png';
+  const desc = '吉林省计算中心文章发布系统';
   const url = encodeURIComponent(location.href.split('#')[0]);
   const wx = Vue.prototype.$wx;
   const res = await store.dispatch('weixin/jsAuth', { url });
@@ -131,9 +134,9 @@ router.afterEach(async (to, form) => {
     });
     wx.ready(() => {
       wx.updateAppMessageShareData({
-        title: '测试',
-        desc: '测试内容',
-        // imgUrl: this.img,
+        title: title,
+        desc: desc,
+        imgUrl: img,
         link: shareUrl,
         success: res => {
           console.log('friend share');
@@ -144,8 +147,7 @@ router.afterEach(async (to, form) => {
       });
       wx.updateTimelineShareData({
         title: '测试',
-        // desc: '测试内容',
-        // imgUrl: this.img,
+        imgUrl: img,
         link: shareUrl,
         success: res => {
           console.log('friends share');