<script>
	import { connectWs, closeWs } from '@/common/websocketManager.js';
	let globalWs = null;

	export default {
		onLaunch() {
			console.log('App Launch');

		},

		onShow() {
			console.log('App Show');
			if (uni.getStorageSync('userInfo')) {
				// 重置重连计数，确保立即重连
				connectWs()
			}
		},

		onHide() {
			console.log('App Hide');
			if (uni.getStorageSync('userInfo')) {
				// 可选择关闭 socket，或只是停止心跳
				closeWs()
			}
		}
	}
</script>

<style lang="scss">
	@import "./uni_modules/vk-uview-ui/index.scss";
	/* 每个页面公共css */
</style>