Browse Source

Merge branch '2024鹅状元' of https://gogs.mtavip.com/wangguoyu/uniProject into 2024鹅状元

tanxue 6 months ago
parent
commit
d7dc9a5c07
1 changed files with 44 additions and 31 deletions
  1. 44 31
      pages/my/index.vue

+ 44 - 31
pages/my/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="lli-develop-expect-page">
-			<button class="lli-btn" @click="quitClick">退出登录</button>
-					<CustomTabBar></CustomTabBar>
+		<button class="lli-btn" @click="quitClick">退出登录</button>
+		<CustomTabBar></CustomTabBar>
 	</view>
 </template>
 
@@ -9,36 +9,49 @@
 	import {
 		logout
 	} from '@/api/login.js'
-	import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
-	import { getCurrentInstance } from 'vue';
-	import {
-		onLoad,
+	import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
+	import {
+		getCurrentInstance
+	} from 'vue';
+	import {
+		onLoad,
 	} from '@dcloudio/uni-app';
-	const quitClick = ()=>{
+	const quitClick = () => {
 		uni.showModal({
-		        title: '提示',
-		        content: '你确定要执行这个操作吗?',
-		        success: (res) => {
-		          if (res.confirm) {
-		            quit();
-		          } else if (res.cancel) {
-		            // 用户点击了取消按钮
-		            console.log('用户点击了取消');
-		          }
-		        }
-		      });
-		
-		 }
-		 const quit = ()=>{
-		 			uni.navigateTo({
-		 				url: '/pages/login/index'
-		 			});
-		 		
-		 		 }
-		 onLoad((options) => {
-			const instance = getCurrentInstance();
-		 	console.log(instance.appContext.config.globalProperties)
-		 })
+			title: '提示',
+			content: '你确定要执行这个操作吗?',
+			success: (res) => {
+				if (res.confirm) {
+					quit();
+				} else if (res.cancel) {
+					// 用户点击了取消按钮
+					console.log('用户点击了取消');
+				}
+			}
+		});
+
+	}
+
+
+
+
+	const quit = () => {
+
+		uni.removeStorage({
+			key: 'Mta-Auth',
+			success: function(res) {
+				console.log('success');
+				uni.navigateTo({
+					url: '/pages/login/index'
+				});
+			}
+		});
+
+	}
+	onLoad((options) => {
+		const instance = getCurrentInstance();
+		console.log(instance.appContext.config.globalProperties)
+	})
 	// import { ref, onMounted } from 'vue';
 	//
 	// const listData = ref([]);
@@ -72,4 +85,4 @@
 
 <style>
 
-</style>
+</style>