<template>
  <div class="main">
    <card title="设置">
      <input
        type="button"
        class="submit-button"
        value="退出登录"
        style="margin-top: calc(100vh - 120px)"
        @click="logout"
      />
    </card>
  </div>
</template>

<script>
import Card from '@/components/Card'
import * as api from '@/api/account'
export default {
  name: 'Settings',
  components: { Card },
  data() {
    return {}
  },
  methods: {
    // 退出登录
    logout() {
      api.logout().then(() => {
        this.$router.push({ name: 'login' })
      })
    }
  }
}
</script>
