App.vue 1.21 KB
Newer Older
lanbaoming's avatar
lanbaoming committed
1
<script>
2 3 4 5 6 7 8 9
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' &&
        this.$route.path != '/pages/register/shareRegister' &&
Smile's avatar
Smile committed
10 11
        this.$route.path != '/pages/register/downloadTips' &&
        this.$route.path != '/pages/deletion/login'
12 13 14 15
      ) {
        uni.redirectTo({
          url: './pages/login/login'
        })
dragondean@qq.com's avatar
dragondean@qq.com committed
16
      }
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
    }
    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 () {}
}
lanbaoming's avatar
lanbaoming committed
38 39 40
</script>

<style>
41
@import url(@/static/css/main.css);
lanbaoming's avatar
lanbaoming committed
42
</style>