<template>
  <van-button
    round
    block
    type="primary"
    @click="logout"
    style="margin-top: 70%"
  >
    登陆注销
  </van-button>
</template>

<script>
import { Button, Dialog } from "vant";
export default {
  name: "Login",
  components: {
    [Button.name]: Button,
  },
  data() {
    return {};
  },
  watch: {},
  created() {
    // this.getCookie();
  },
  methods: {
    // 退出登录
    logout() {
      Dialog.confirm({
        title: "是否退出当前账户",
        message: "退出后再次使用需重新登录",
      })
        .then(() => {
          this.$store.dispatch("LogOut").then(() => {
            this.$router.replace("login");
          });
        })
        .catch(() => {
          // on cancel
        });
    },
  },
};
</script>

<style rel="stylesheet/scss" lang="scss">
.title {
  margin: 30px auto 30px auto;
  text-align: center;
  color: #707070;
}

</style>
