<template>
	<view class="">
		<button type="warn" @click="logout">退出登录</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		onLoad() {},
		methods: {
			logout() {
				uni.showModal({
					title: '确认退出',
					content: '是否退出当前账号？',
					success: (res) => {
						if (res.confirm) {
							// 清除本地数据
							uni.removeStorageSync('accessToken');
							uni.removeStorageSync('userInfo');
							uni.reLaunch({
								url: '/pages/login/index'
							});
						}
					}
				});

			}
		}
	}
</script>

<style>
</style>