Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/2024鹅状元' into 2024鹅状元

wangxy 5 mesi fa
parent
commit
77bd714fff
1 ha cambiato i file con 6 aggiunte e 10 eliminazioni
  1. 6 10
      pages/my/index.vue

+ 6 - 10
pages/my/index.vue

@@ -37,12 +37,12 @@
 </template>
 
 <script setup>
+	import cacheManager from '@/utils/cacheManager.js';
 	import {logout} from '@/api/login.js'
 	import {myInfo} from '@/api/my.js'
 	import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
 	import {getCurrentInstance} from 'vue';
 	import {onLoad} from '@dcloudio/uni-app';
-	import {getAuth} from '@/utils/auth.js';
 	import {reactive,ref} from "vue";
 	import { toast } from "../../utils/common";
 	import exitDialog from './exitDialog.vue'
@@ -61,14 +61,9 @@
 	}
 
 	const exitBtn = () => {
-		uni.removeStorage({
-			key: 'Mta-Auth',
-			success: function(res) {
-				console.log('success');
-				uni.navigateTo({
-					url: '/pages/login/index'
-				});
-			}
+		cacheManager.clearAll();
+		uni.navigateTo({
+			url: '/pages/login/index'
 		});
 
 	}
@@ -127,7 +122,8 @@
 	
 	// 判断是否登陆
 	function myGetAuth(){
-		if (getAuth()) {
+		let LocalStorage = cacheManager.get('auth');
+		if (LocalStorage) {
 			// 已登录
 			loginFlag.value = true;
 			console.log(loginFlag.value,'已登录');