<script>
import Cookies from 'js-cookie'
export default {
  onLaunch: function () {
    uni.$u.http.get('/api/blade-token/currentUser').then(res => {
      let {instType} = res.detail
      let isSingle = instType === 1
      this.$store.commit('setUser', {isSingle})
      const Yxtoken = Cookies.get('congress')
      const redirect = window.location.href;
      if (Yxtoken) {
        uni.redirectTo({url: isSingle ? '/pages/home/me' : '/pages/home/home'});
      } else {
        // 跳转到iam 用户端登陆
        window.location.href = `${window._CONFIG.VUE_APP_BASE_URLS}/account/#/login?redirect=${redirect}`;
      }
    })
  },
  onShow: function () {

  },
  onHide: function () {

  }
}
</script>

<style lang="scss">
/*每个页面公共css */
@import "@/uni_modules/uview-ui/index.scss";
@import "common/demo.scss";
@import "common/tool.css";
page {
  background-color: #f6f6f6;
}
.iframe {
  width: 100%;
  height: calc(100% - 176rpx);
}
.u-picker {
  .u-picker__view__column__item {
    font-weight: 500 !important;
  }
}
</style>
