<template>
	<div>
		<common @asynCallBack="asynCallBack" :projectCheck="false"></common>
	</div>
</template>

<script>
	import * as Dictionaries from '$project/utils/dictionaries'
	import Common from '$project/components/Common.vue'
	import {
		mapGetters,
		mapMutations
	} from 'vuex'
	export default {
		name: 'Home',
		components: {
			Common,
		},
		data() {
			return {}
		},
		created() {},
		methods: {
			asynCallBack() {
				//登录状态判断
				if (this.person_popedom) {
					 let project = Dictionaries.getProject(this.person_popedom.sceneId);
					// setTimeout(function() {
					// 	window.location.href = '../' + project + '/#/master';
					// }, 1000);
				
					
					this.$router.push({
											name: 'UserLogin',
											query: {
												project:project
											}
					})
				} else {
					if (process.env.VUE_APP_NODE_NAME == 'production') {
						window.location.href="http://xpgj.xiaoxinda.com/xpgj/prod/home/#/select"
						
 					}else  if (process.env.VUE_APP_NODE_NAME == 'test') {
						window.location.href="http://xpgj.xiaoxinda.com/xpgj/test/home/#/select"
						
					}
					else{
						 this.$router.push({
						 						name: 'Select',
						 					
						 					})
					}
					
					// this.$router.push({
					// 						name: 'Select',
										
					// 					})
					// if (process.env.VUE_APP_NODE_NAME == 'production') {
					// 	window.location.href = 'http://xpgj.xiaoxinda.com/xpgj/prod/home/#/select';
					// }else{
					// 	window.location.href = 'http://xpgj.xiaoxinda.com/#/select'; 
					// }
					
				}
			},
		},
		mounted() {},
		destroyed() {

		},
		computed: {
			...mapGetters({
				openId: 'wx_openid',
				token: 'token',
				person_data: 'person_data',
				person_popedom: 'person_popedom',
			})
		}
	}
</script>

<style src="$project/assets/css/iconfont.css"></style>
<style scoped src="$project/assets/css/xpwyfyy.css"></style>
<style scoped>
</style>
