<script>
	import {
		mapMutations
	} from "vuex";
	import {
		createMobileToken
	} from '@/api/pages/login/index.js'
	export default {
		onLaunch: function() {},
		methods: {
			...mapMutations(['socketOpenfalse']),
		},
		onShow: function() {
			createMobileToken().then(res => {
				uni.setStorageSync("token", res.data.token)
			})
		},
		onHide: function() {
			this.socketOpenfalse();
			uni.closeSocket();
			clearInterval(this.$store.state.timeoutObj);
		}
	}
</script>

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

	/*每个页面公共css */
	page {
		background-color: #F4F5F7;
	}

	.app {
		width: 100%;
		height: 100%;
		text-align: justify;
		color: #000000;
	}
</style>