Parcourir la source

[edit] facebook link image

wenliming il y a 2 ans
Parent
commit
542d436adb
2 fichiers modifiés avec 12 ajouts et 0 suppressions
  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,
 			isMobile: false,
 			isChrome: false,
 			isChrome: false,
 			linkHref: '',
 			linkHref: '',
+			pageLink: '',
 		};
 		};
 	},
 	},
 	components: {
 	components: {
@@ -100,6 +101,10 @@ export default {
 					name: 'og:image',
 					name: 'og:image',
 					content: this.detail.imagePath || '',
 					content: this.detail.imagePath || '',
 				},
 				},
+				{
+					name: 'og:url',
+					content: this.pageLink,
+				},
 				// twitter
 				// twitter
 				{
 				{
 					name: 'twitter:card',
 					name: 'twitter:card',
@@ -136,6 +141,7 @@ export default {
 		if (data.code == 0) {
 		if (data.code == 0) {
 			return {
 			return {
 				detail: data.data,
 				detail: data.data,
+				pageLink: `${jumpUrl}treasure/${route.params.id}`,
 			};
 			};
 		}
 		}
 	},
 	},

+ 6 - 0
pages/treasure/invite.vue

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