<template>
  <view>
    <u-navbar title="设置" @rightClick="rightClick" :autoBack="true"></u-navbar>
    <view style="margin-top: 180rpx;">
      <u-button type="primary" @click="quitLogin">退出登录</u-button>
    </view>
  </view>
</template>

<script>
  import * as API_item from '@/api/login.js';
  export default {
    data() {
      return {
        
      }
    },
    methods: {
      quitLogin(){
        API_item.logout({}).then(res=>{
        	if(res.code == 101){
            uni.showToast({		// 提示错误信息
              title: '退出成功',
              icon:'success',
              duration: 3000
            })
            uni.removeStorageSync('token')
            uni.removeStorageSync('userInfo') 
            uni.navigateTo({
              url: "/pages/login/login",
            });
          }
          })

        }
    }
  }
</script>

<style>

</style>
