<script>
	export default {
		onLaunch: function() {
			try {
				var loginTime = uni.getStorageSync("loginTime");
				if (null != loginTime) {
					var dt = new Date();
					var time = dt.getTime();
					var expires = this.userInfo.expires_in;
					if ((time - loginTime) / 1000 > (expires - 60)) {					
						uni.reLaunch({
							url: "pages/login/login-account",
							success: () => {
								plus.navigator.closeSplashscreen();
							}
						})
					} else {
						plus.navigator.closeSplashscreen();
					}
				} else {
					uni.reLaunch({
						url: "pages/login/login-account",
						success: () => {
							plus.navigator.closeSplashscreen();
						}
					})
				}
			} catch (e) {
				uni.reLaunch({
					url: "pages/login/login-account",
					success: () => {
						plus.navigator.closeSplashscreen();
					}
				})
			}
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>
<style lang="scss">
	/*uview全局样式*/
	@import "uview-ui/index.scss";
	/*app全局样式*/
	@import 'static/style/app.scss';
</style>
