<script>
	// import routingIntercept  from '@/common/permission.js'
	import {
		getToken
	} from '@/common/auth.js'
	export default {

		methods: {},
		onLaunch(e) {
			// 限制必须在微信中打开H5连接，即公众号中打开
			var ua = navigator.userAgent.toLowerCase();
			var isWeixin = ua.indexOf('micromessenger') != -1;
			// if (!isWeixin) {
			// 	// window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxeb15ff6b40432045"
			// 	window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=888"
			// }
			const {
				path
			} = e
			const whiteList = ['pages/entryPage/entryPage']
			// 开发时使用
			// const whiteList = ['pages/entryPage/entryPage', 'pages/createInfo/createInfo', 'pages/searchState/searchState']
			if (!getToken()) {
				// 非老人自主注册页面, 不允许直接进入
				if (!(whiteList.includes(path))) {
					uni.reLaunch({
						url: '/pages/login/index'
					})
				}
			}
		},
		onShow: function() {},
		onHide: function() {},
		onReady() {

		},

	}
</script>

<style>
	/*每个页面公共css */
	@font-face {
		/* 	font-family: 'puhui';
		src: url('./static/fonts/AlibabaPuHuiTi-3-65-Medium.ttf'); */
	}

	.global-font {
		/* font-family: 'puhui';
		font-size: 16px;
		color: #333; */
	}

	uni-page-body,
	html,
	body {
		height: 100%;
	}
</style>