mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-09 18:53:43 +08:00
1. 发起 socket 连接时候传入 chatId 来区分会话。
2. Chat-Plus 界面新增复制回复内容按钮。 3. 优化 ChatFree 聊天会话切换和管理逻辑。
This commit is contained in:
@@ -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;
|
||||
}
|
||||
8
web/src/utils/prototype.js
vendored
8
web/src/utils/prototype.js
vendored
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user