<script>
	export default {
		onLaunch: function() {
			// #ifdef APP-PLUS
			try {
				let loginTime = uni.getStorageSync("loginTime");
				if (loginTime) {
					let dt = new Date();
					let time = dt.getTime();
					let expires = this.userInfo.expires_in;
					if (expires) {
						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();
							}
						})
					}
				} 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();
					}
				})
			}
			// #endif
		},
		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>