Browse Source

[edit][req]

zhangwei 2 years ago
parent
commit
9f76c294d1
1 changed files with 4 additions and 1 deletions
  1. 4 1
      pages/treasure/invite.vue

+ 4 - 1
pages/treasure/invite.vue

@@ -92,6 +92,7 @@ export default {
 			isChrome: false,
 			isChrome: false,
 			linkHref: '',
 			linkHref: '',
 			pageLink: '',
 			pageLink: '',
+			headers: {},
 		};
 		};
 	},
 	},
 	components: {
 	components: {
@@ -133,7 +134,6 @@ export default {
 		};
 		};
 	},
 	},
 	async asyncData({ route, req }) {
 	async asyncData({ route, req }) {
-		console.log('X-Forwarded-For', req.headers['X-Forwarded-For']);
 		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,
@@ -148,10 +148,12 @@ export default {
 			pageLink = `${pageLink}/${route.params.channel}`;
 			pageLink = `${pageLink}/${route.params.channel}`;
 		}
 		}
 
 
+		console.log('11', JSON.stringify(req.headers));
 		if (data.code == 0) {
 		if (data.code == 0) {
 			return {
 			return {
 				detail: data.data,
 				detail: data.data,
 				pageLink,
 				pageLink,
+				headers: JSON.stringify(req),
 			};
 			};
 		}
 		}
 	},
 	},
@@ -159,6 +161,7 @@ export default {
 		this.getConfig();
 		this.getConfig();
 	},
 	},
 	mounted() {
 	mounted() {
+		console.log('headers', 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();