<script>
	export default {
		onLaunch: function() {

			let Authorization = uni.getStorageSync('Authorization')
			if((!Authorization || Authorization == '')){
        if(this.$route.path != '/pages/register/register' && this.$route.path != '/pages/activityShare/index' ){
          uni.redirectTo({
				  	url: './pages/login/login'
			  	})
        }
				
			}
      if(Authorization && !this.$store.state.userInfo){
        this.$store.dispatch('updateUserInfo')
      }
			//#ifdef APP-PLUS
			plus.runtime.getProperty( plus.runtime.appid, function ( wgtinfo ) {
					//  获取 app的version
					let appversion = wgtinfo.version;
					let versionCode = wgtinfo.versionCode
					// 存缓存 版本号
					try {
						uni.setStorageSync('appversion', appversion);
						uni.setStorageSync('versionCode', versionCode);
					} catch (e) {}
					console.log( "appversion:" + appversion );
				} );
			//#endif
		},
		onShow: function() {
		},
		onHide: function() {
		}
	}
</script>

<style>
	@import url(@/static/css/main.css);
</style>
