<script>
	import {

	} from './common/api.js'
	import {getAuthsArr,BeforeNavigateTo} from './common/utils.js'
	//#ifdef APP-PLUS
	import APPUpdate from '@/uni_modules/APPUpdate/js_sdk/appUpdate';
	//#endif
	export default {
		onLaunch: function() {
			const Token = uni.getStorageSync('xj-storage_token')
			if(Token){
				uni.reLaunch({
					url: '/pages/native/work',
					success:() => {
						plus.navigator.closeSplashscreen();
					}
				})
			}
			else{
				plus.navigator.closeSplashscreen();
			}
			//#ifdef APP-PLUS
		   setTimeout(() =>{
			//   APPUpdate()
		   },5000)
			const _handlePush =(message) => {
				uni.switchTab({
					url:'/pages/native/news'
				})
				console.log(message)
			};
			plus.push.addEventListener('click', (message) => {
				_handlePush(message);
			});
			plus.push.addEventListener('receive',(message) => {
				_handlePush(message);
			});
			// #endif
		},
		onShow: function() {

			console.log('App Show')
		},
		onHide: function() {
			uni.closeSocket();
			console.log('App Hide')
		}
    }
</script>

<style lang="scss">
@import "@/static/iconfont.css";
@import '@/common/common.css';
</style>
