<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
import { getList } from '@/api/finance/refund'
import { getToken } from '@/utils/auth'
export default {
  name: 'App',
  mounted() {
    if (getToken()) {
      getList({ page_index: 1, page_size: 10 }).then(({ data: { total: num }}) => {
        setTimeout(() => {
          const index = this.$store.state.unreadMessage.findIndex(e => e.name === 'finance_refund')
          this.$store.commit('unreadMessage/UNREAD_MESSAGE_NUM_CHANGE', { index, num })
        }, 567)
      })
    }
  }
}
</script>
