Browse Source

[edit] facebook link image

wenliming 2 years ago
parent
commit
542d436adb
2 changed files with 12 additions and 0 deletions
  1. 6 0
      pages/treasure/index.vue
  2. 6 0
      pages/treasure/invite.vue

+ 6 - 0
pages/treasure/index.vue

@@ -80,6 +80,7 @@ export default {
 			isMobile: false,
 			isChrome: false,
 			linkHref: '',
+			pageLink: '',
 		};
 	},
 	components: {
@@ -100,6 +101,10 @@ export default {
 					name: 'og:image',
 					content: this.detail.imagePath || '',
 				},
+				{
+					name: 'og:url',
+					content: this.pageLink,
+				},
 				// twitter
 				{
 					name: 'twitter:card',
@@ -136,6 +141,7 @@ export default {
 		if (data.code == 0) {
 			return {
 				detail: data.data,
+				pageLink: `${jumpUrl}treasure/${route.params.id}`,
 			};
 		}
 	},

+ 6 - 0
pages/treasure/invite.vue

@@ -84,6 +84,7 @@ export default {
 			isMobile: false,
 			isChrome: false,
 			linkHref: '',
+			pageLink: '',
 		};
 	},
 	components: {
@@ -104,6 +105,10 @@ export default {
 					name: 'og:image',
 					content: this.detail.imagePath || '',
 				},
+				{
+					name: 'og:url',
+					content: this.pageLink,
+				},
 				// twitter
 				{
 					name: 'twitter:card',
@@ -140,6 +145,7 @@ export default {
 		if (data.code == 0) {
 			return {
 				detail: data.data,
+				pageLink: `${jumpUrl}treasure/invite/${route.params.id}/${route.params.channel}`,
 			};
 		}
 	},