Browse Source

bug: fix share

zjxpcyc 6 years ago
parent
commit
c189296e91
2 changed files with 12 additions and 2 deletions
  1. 6
    1
      src/views/vote/detail.vue
  2. 6
    1
      src/views/vote/list.vue

+ 6
- 1
src/views/vote/detail.vue View File

@@ -60,8 +60,13 @@ export default {
60 60
         hash = `#/detail/${this.actid}/${this.memberid}`
61 61
       }
62 62
 
63
+      let pathname = window.location.pathname
64
+      if (!pathname.endsWith('/')) {
65
+        pathname += '/'
66
+      }
67
+
63 68
       wxsdk(
64
-        { url: window.encodeURIComponent(`${window.location.origin}${window.location.pathname}`) },
69
+        { url: window.encodeURIComponent(`${window.location.origin}${pathname}`) },
65 70
         {
66 71
           title: act.ShareTitle,
67 72
           desc: act.ShareDesc,

+ 6
- 1
src/views/vote/list.vue View File

@@ -191,10 +191,15 @@ export default {
191 191
         hash = `#/vote/${this.actid}`;
192 192
       }
193 193
 
194
+      let pathname = window.location.pathname
195
+      if (!pathname.endsWith('/')) {
196
+        pathname += '/'
197
+      }
198
+
194 199
       wxsdk(
195 200
         {
196 201
           url: window.encodeURIComponent(
197
-            `${window.location.origin}${window.location.pathname}`
202
+            `${window.location.origin}${pathname}`
198 203
           )
199 204
         },
200 205
         {