<template>
  <div class="author">
    <div class="img" :style="{backgroundImage:`url(${loadingUrl})`}"></div>
    <p>正在加载中......</p>
    <p class="reload" :click="onPageReload">点击重新加载</p>
  </div>
</template>

<script>
  import loadingUrl from '../assets/authorLoading.png'
export default {
  name: 'author',
  data () {
    return {
      loadingUrl: loadingUrl
    }
  },
  created () {
    if(this.$route.query && this.$route.query.retUrl){
      localStorage.setItem('retUrl',this.$route.query.retUrl);
    }else{
      localStorage.setItem('retUrl','');
    }
    if(this.$route.query && this.$route.query.is_new_user_url){
      window.location.href = `${process.env.AUTHOR_UEL}`
    }else{
      localStorage.setItem('retUrl','');
      window.location.href = `${process.env.AUTHOR_UEL}&is_new_user_url=1`
    }
  },
  methods: {
    onPageReload: function () {
      this.$sa.track('buttonClick',{
        tabTitle:'授权',
        moduleTitle:'授权',
        buttonType:'重新授权',
        buttonName:'重新授权'
      });
      window.location.reload()
    }
  }
}
</script>
<style scoped lang="less">
  .author {
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-size: 1.8rem;
    &>.img {
      width: 50vw;
      height: 50vw;
      background-size: 100% 100%;
    }
    .reload {
      font-size: 1.2rem;
      color: #199be0;
    }
  }
</style>
