Przeglądaj źródła

fix: 调整登录后页面调整模块

wenxingxing 1 dzień temu
rodzic
commit
16fff77bc9
3 zmienionych plików z 37 dodań i 2 usunięć
  1. 2 1
      pages/auth/login.vue
  2. 2 1
      pages/auth/wechatList.vue
  3. 33 0
      pages_mall/my.vue

+ 2 - 1
pages/auth/login.vue

@@ -706,7 +706,8 @@ export default {
 				this.$updateMsgDot();
 				this.$setSource();
 				uni.reLaunch({
-					url: '/pages_im/pages/conversation/conversationList/index',
+					// url: '/pages_im/pages/conversation/conversationList/index',
+					url: '/pages/index/index',
 					animationType: 'none',
 					animationDuration: 2000
 				});

+ 2 - 1
pages/auth/wechatList.vue

@@ -112,7 +112,8 @@
 					this.$updateMsgDot();
 					this.$setSource();
 					uni.reLaunch({
-						url: '/pages_im/pages/conversation/conversationList/index',
+						// url: '/pages_im/pages/conversation/conversationList/index',
+						url: '/pages/index/index',
 						animationType: 'none',
 						animationDuration: 2000
 					});

+ 33 - 0
pages_mall/my.vue

@@ -110,6 +110,12 @@
 </template>
 
 <script>
+	import IMSDK, {
+		SessionType
+	} from "openim-uniapp-polyfill";
+	import {
+		Igexin
+	} from '@/pages_im/util/common.js';
 	import {
 		getUserInfo
 	} from '@/api/user'
@@ -223,6 +229,33 @@
 					}
 				});
 			},
+			logout() {
+				uni.clearStorage()
+				this.$logout();
+				let IMUserID = uni.getStorageSync('IMUserID');
+				IMSDK.asyncApi(IMSDK.IMMethods.Logout, IMSDK.uuid()).then(() => {
+						callingModule?.endCall();
+						meetingModule?.endCall();
+					}).catch((err) => console.log(err))
+					.finally(() => {
+						Igexin.unbindAlias(IMUserID);
+						uni.removeStorage({
+							key: "IMToken"
+						});
+						uni.removeStorage({
+							key: "IMUserID"
+						});
+						uni.removeStorage({
+							key: "IMHasLogin"
+						});
+
+					});
+
+				this.user = this.defUser;
+				this.coupons.expiredCount = 0;
+				this.coupons.notUsedCount = 0;
+				this.coupons.usedCount = 0;
+			},
 			getGoodsProducts() {
 				var that = this;
 				if (that.likeGoodsHasMore == true || that.likeGoodsLoading == true) return;