<template>
  <view class="content">
    <view>
      <u-button type="primary" text="退出登录" @click="handleLogout"></u-button>
    </view>
  </view>
</template>

<script>
import { logout } from '@/pages/api'
export default {
  methods: {
    async handleLogout() {
      try {
        await logout();
      } catch (e) {}
      uni.removeStorageSync('token');
      uni.reLaunch({
        url: '/pages/login/login'
      });
    }
  }
}
</script>

<style lang="scss" scoped>
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
</style>
