<template>
  <a-config-provider :locale="zh_CN">
    <div v-if="anyringToken" class="d-flex flex-column flex-wrap pt-46" id="app">
      <router-view class="flex-1 bg fill-width"></router-view>
    </div>
  </a-config-provider>
</template>

<script>
import { mapState, mapActions, mapMutations } from 'vuex';
import zh_CN from 'ant-design-vue/lib/locale-provider/zh_CN';
export default {
  name: 'App',
  data() {
    return { zh_CN };
  },
  computed: mapState('home', ['anyringToken']),
  mounted() {
    window.addEventListener('unload', this.saveState);
  },
  async created() {
    const userId = '1462629589099614208';
    const params = { userId };
    await this.getUserId(params);
    await this.getToken();
  },

  methods: {
    ...mapActions('home', ['getUserId']),
    ...mapMutations('home', ['getToken', 'setHistoryNum']),
  },
};
</script>

<style>
html,
body,
#app {
  min-height: 100%;
}
#app {
  background: transparent;
}
body::-webkit-scrollbar {
  width: 0;
}
/* .pt-46 {
  padding-top: 46px;
} */
</style>

<style lang="stylus">
@import './common/portrait.styl';
</style>
