Ver Fonte

1.修复断线重连时丢消息的bug
2.修复下载文件名异常的bug
3.去除多余的返回按钮

xsx há 1 ano atrás
pai
commit
d334fdc4d9

+ 1 - 0
im-uniapp/App.vue

@@ -311,6 +311,7 @@
 				return new Promise((resolve, reject) => {
 					if (!loginInfo || !loginInfo.refreshToken) {
 						reject();
+						return;
 					}
 					http({
 						url: '/refreshToken',

+ 1 - 0
im-uniapp/components/chat-item/chat-item.vue

@@ -100,6 +100,7 @@
 			position: absolute;
 			width: 100%;
 			height: 100%;
+			z-index: 99;
 		}
 
 		.left {

+ 0 - 10
im-uniapp/pages/chat/chat-box.vue

@@ -1,7 +1,6 @@
 <template>
 	<view class="page chat-box">
 		<view class="header">
-			<uni-icons class="btn-side left" type="back" size="30" @click="onNavBack()"></uni-icons>
 			<text class="title">{{title}}</text>
 			<uni-icons class="btn-side right" type="more-filled" size="30" @click="onShowMore()"></uni-icons>
 		</view>
@@ -344,11 +343,6 @@
 			selectEmoji(emoText) {
 				this.sendText += `#${emoText};`;
 			},
-			onNavBack() {
-				uni.switchTab({
-					url: "/pages/chat/chat"
-				})
-			},
 			onKeyboardheightchange(e) {
 				if (e.detail.height > 0) {
 					this.showKeyBoard = true;
@@ -797,10 +791,6 @@
 				font-size: 28rpx;
 				cursor: pointer;
 
-				&.left {
-					left: 30rpx;
-				}
-
 				&.right {
 					right: 30rpx;
 				}

+ 5 - 2
im-uniapp/store/chatStore.js

@@ -302,7 +302,7 @@ export default defineStore('chatStore', {
 			});
 			// 将消息一次性装载回来
 			this.chats = cacheChats;
-			// 清空缓存
+			// 清空缓存,不再使用
 			cacheChats = null;
 			this.saveToStorage();
 		},
@@ -375,7 +375,10 @@ export default defineStore('chatStore', {
 			return state.loadingPrivateMsg || state.loadingGroupMsg
 		},
 		curChats: (state) => {
-			return state.isLoading() ? cacheChats : state.chats;
+			if(cacheChats && state.isLoading()){
+				return cacheChats;
+			}
+			return state.chats;
 		},
 		findChatIdx: (state) => (chat) => {
 			let chats = state.curChats;

+ 1 - 1
im-web/src/components/chat/ChatMessageItem.vue

@@ -36,7 +36,7 @@
 							<div class="chat-file-box" v-loading="loading">
 								<div class="chat-file-info">
 									<el-link class="chat-file-name" :underline="true" target="_blank" type="primary"
-										:href="data.url">{{ data.name }}</el-link>
+										:href="data.url" :download="data.name">{{ data.name }}</el-link>
 									<div class="chat-file-size">{{ fileSize }}</div>
 								</div>
 								<div class="chat-file-icon">

+ 1 - 2
im-web/src/components/group/AddGroupMember.vue

@@ -2,8 +2,7 @@
 	<el-dialog title="邀请好友" :visible.sync="visible" width="50%" :before-close="onClose">
 		<div class="agm-container">
 			<div class="agm-l-box">
-				<el-input placeholder="搜索好友" v-model="searchText"
-					@keyup.enter.native="onSearch()">
+				<el-input placeholder="搜索好友" v-model="searchText">
 					<i class="el-icon-search el-input__icon" slot="suffix"> </i>
 				</el-input>
 				<el-scrollbar style="height:400px;">

+ 5 - 2
im-web/src/store/chatStore.js

@@ -289,7 +289,7 @@ export default {
 			});
 			// 将消息一次性装载回来
 			state.chats = cacheChats;
-			// 清空缓存
+			// 清空缓存,不再使用
 			cacheChats = null;
 			this.commit("saveToStorage");
 		},
@@ -369,7 +369,10 @@ export default {
 			return state.loadingPrivateMsg || state.loadingGroupMsg
 		},
 		findChats: (state, getters) => () => {
-			return getters.isLoading() ? cacheChats : state.chats;
+			if(cacheChats && getters.isLoading()){
+				return cacheChats;
+			}
+			return state.chats;
 		},
 		findChatIdx: (state, getters) => (chat) => {
 			let chats = getters.findChats();