unipp 小程序 退出登录

<template>
	<view @click="toLogout">
</template>
//退出登录
	toLogout: function() {
    
    
		uni.showLoading();
		var params = {
    
    
			url: "/xxx/logout",
			method: "DELETE",
			data: {
    
    },
			callBack: res=> {
    
    
				uni.hideLoading()
				console.log(res)
				uni.removeStorageSync('loginResult');
				uni.removeStorageSync('token');
				uni.removeStorageSync('hadLogin');
				uni.removeStorageSync('code');
				uni.navigateTo({
    
    
					url:"/pages/login/login"
				})
			}
		};
		http.request(params);
	}

猜你喜欢

转载自blog.csdn.net/maoge_666/article/details/131581277