zhangwei 2 år sedan
förälder
incheckning
7a2de8c209
1 ändrade filer med 5 tillägg och 2 borttagningar
  1. 5 2
      pages/treasure/invite.vue

+ 5 - 2
pages/treasure/invite.vue

@@ -86,6 +86,7 @@ export default {
 				amountUsdValue: '',
 				amountUsdValue: '',
 				totalCount: '',
 				totalCount: '',
 			},
 			},
+			headers: {},
 			config: {},
 			config: {},
 			title: 'Treasure Hunt',
 			title: 'Treasure Hunt',
 			isMobile: false,
 			isMobile: false,
@@ -132,8 +133,8 @@ export default {
 			],
 			],
 		};
 		};
 	},
 	},
-	async asyncData(params) {
-		let { route } = params;
+	async asyncData({ route, req }) {
+		const headers = req && req.headers ? Object.assign({}, req.headers) : {};
 		let { data } = await axios.post(`${baseURL}/denet/post/treasure/invite/detail`, {
 		let { data } = await axios.post(`${baseURL}/denet/post/treasure/invite/detail`, {
 			baseInfo: {
 			baseInfo: {
 				appVersionCode: appVersionCode,
 				appVersionCode: appVersionCode,
@@ -152,6 +153,7 @@ export default {
 			return {
 			return {
 				detail: data.data,
 				detail: data.data,
 				pageLink,
 				pageLink,
+				headers,
 			};
 			};
 		}
 		}
 	},
 	},
@@ -159,6 +161,7 @@ export default {
 		this.getConfig();
 		this.getConfig();
 	},
 	},
 	mounted() {
 	mounted() {
+		console.log('header', this.headers);
 		this.setCookieMid();
 		this.setCookieMid();
 		Cookies.set(this.detail.postId, JSON.stringify({ inviteCode: this.$route.params.id, channel: this.$route.params.channel }), { expires: 100 });
 		Cookies.set(this.detail.postId, JSON.stringify({ inviteCode: this.$route.params.id, channel: this.$route.params.channel }), { expires: 100 });
 		this.setTreasureInfo();
 		this.setTreasureInfo();