<script>
	// import config from './config'
	import config from '@/config/environment.js'
	import store from '@/store'
	import {
		getToken
	} from '@/utils/auth'

	export default {
		onLaunch: function() {
			this.initApp()
		},
		methods: {
			// 初始化应用
			initApp() {
				// 初始化应用配置
				this.initConfig()
				// 检查用户登录状态
				//#ifdef H5
				this.checkLogin()
				//#endif
				// #ifdef APP
				uni.reLaunch({url: '/pages/home/index'})
				// #endif
			},
			initConfig() {
				this.globalData.config = config
			},
			checkLogin() {
				const pages = getCurrentPages();
				if(pages?.length === 0){
					this.$tab.reLaunch('/pages/home/index')
				}else if (!getToken()) {
					this.$tab.reLaunch('/pages/login')
				}
			}
		}
	}
</script>

<style lang="scss">
	/* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
	@import "@/uni_modules/uview-ui/index.scss";
	@import '@/static/scss/index.scss'
	
	
</style>
<style>

	.full-height-with-titile{
		height: calc(100vh - 0px) !important;
	}
	.full-height-without-titile{
		height: 100vh !important;
	}
	.container-with-lines{
		height: 100vh;
		padding: 10rpx 20rpx;
		background-color: #2C53CA;
		background-image: url('/static/svgs/lines.svg');
		background-size: 360%;
		background-position: center;
	}
	.container-with-elep{
		height: 100vh;
		background-color: #2345B2 !important;
		padding: 20rpx !important;
		background-image: url(/static/img/ele.png) !important;
		background-position: bottom right !important;
		background-size: 80% !important;
		background-repeat: no-repeat  !important;
	}
</style>