|
@@ -68,7 +68,7 @@
|
|
style="width: 100%; margin-bottom: 1em"
|
|
style="width: 100%; margin-bottom: 1em"
|
|
color="#f3f4f6"
|
|
color="#f3f4f6"
|
|
size="large"
|
|
size="large"
|
|
- @click="chat = []"
|
|
|
|
|
|
+ @click="(chat = []), (chatlist = [])"
|
|
>
|
|
>
|
|
清除历史记录
|
|
清除历史记录
|
|
</el-button>
|
|
</el-button>
|
|
@@ -155,7 +155,7 @@ const num1 = ref(0.7);
|
|
const num2 = ref(0.95);
|
|
const num2 = ref(0.95);
|
|
let chatlist = ref([]);
|
|
let chatlist = ref([]);
|
|
let session_hash = Math.random().toString(36).substring(2);
|
|
let session_hash = Math.random().toString(36).substring(2);
|
|
-let index = -1;
|
|
|
|
|
|
+let index = 0;
|
|
function saveText() {
|
|
function saveText() {
|
|
load.value = true;
|
|
load.value = true;
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
@@ -175,10 +175,10 @@ function saveText() {
|
|
const t = inputText.value;
|
|
const t = inputText.value;
|
|
inputText.value = '';
|
|
inputText.value = '';
|
|
|
|
|
|
|
|
+// index++;
|
|
if (chatlist.value.length > 5) {
|
|
if (chatlist.value.length > 5) {
|
|
chatlist.value.shift();
|
|
chatlist.value.shift();
|
|
}
|
|
}
|
|
- index++;
|
|
|
|
createSocket(ws => {
|
|
createSocket(ws => {
|
|
const data = ws.data || {};
|
|
const data = ws.data || {};
|
|
if (data.msg == 'send_hash')
|
|
if (data.msg == 'send_hash')
|