1. 发起 socket 连接时候传入 chatId 来区分会话。

2. Chat-Plus 界面新增复制回复内容按钮。
3. 优化 ChatFree 聊天会话切换和管理逻辑。
This commit is contained in:
RockYang
2023-04-21 11:21:41 +08:00
parent 00db78b446
commit d8bc0fe125
9 changed files with 168 additions and 80 deletions

View File

@@ -72,3 +72,17 @@ export function dateFormat(timestamp, format) {
}
return timeDate;
}
export function arrayContains(array, value, compare) {
if (typeof compare !== 'function') {
compare = function (v1, v2) {
return v1 === v2;
}
}
for (let i = 0; i < array.length; i++) {
if (compare(array[i], value)) {
return true;
}
}
return false;
}

View File

@@ -1,8 +0,0 @@
// add prototype method for array to insert item
Array.prototype.insert = function (index, item) {
this.splice(index, 0, item)
}
Array.prototype.remove = function (index) {
this.splice(index, 1)
}