<script>
	import {
		createRequestPermissionListener,
		stopRequestPermissionListener
	} from '@/uni_modules/colorful-uni-perm';

	export default {
		onLaunch: function() {
			// #ifdef APP-PLUS
			if (plus.runtime.channel === 'huawei') {
				// 创建权限申请监听
				createRequestPermissionListener();
			}
			// #endif
			console.log('App Launch')
			let token = uni.getStorageSync("token")
			if (token) {
				plus.navigator.closeSplashscreen();
				return
			}
			uni.reLaunch({
				url: "/pages/login/login",
				success() {
					plus.navigator.closeSplashscreen();
				}
			})
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		onExit() {
			// #ifdef APP-PLUS
			if (plus.runtime.channel === 'huawei') {
				// 清除权限申请监听
				stopRequestPermissionListener();
			}
			// #endif
		},
	}
</script>

<style lang="scss">
	@import "./uni_modules/vk-uview-ui/index.scss";
</style>