chd há 5 meses atrás
pai
commit
2dd45c6388

+ 1 - 1
src/entrypoints/sidepanel/Chat.vue

@@ -220,7 +220,7 @@ const handleUpload =async (file) => {
           const res2 = await getFormKeyAndValue(data,response.data)
         xlsxData.value = res2.data
         msg.rawContent = buildObjPrompt(res2.data, response.data)
-          console.log();
+          console.log(msg);
           
           const a = await streamRes()
           handleInput(xlsxData.value,JSON.parse(a.split('json')[1].split('```')[0]))

+ 13 - 13
src/entrypoints/sidepanel/hook/useMsg.ts

@@ -28,7 +28,7 @@ export function useMsg(scrollbar?: any) {
        timestamp: moment().format('YYYY-MM-DD HH:mm:ss'),
        isSelf: false,
        avatar: avator,
-       addToHistory: !taklToHtml.value
+       addToHistory: false
      })
     try {
       sendLoading.value = true
@@ -44,20 +44,20 @@ export function useMsg(scrollbar?: any) {
     }
     }
     const getFormKeyAndValue = async (file: any, form?: any) => {
-        const obj = reactive({
-            id: moment(),
-            username: '用户1',
-            rawContent: '',
-            content: '解析文件中',
-            timestamp: moment().format('YYYY-MM-DD HH:mm:ss'),
-            isSelf: false,
-            avatar: avator,
-            addToHistory: !taklToHtml.value
-        })
+        // const obj = reactive({
+        //     id: moment(),
+        //     username: '用户1',
+        //     rawContent: '',
+        //     content: '解析文件中',
+        //     timestamp: moment().format('YYYY-MM-DD HH:mm:ss'),
+        //     isSelf: false,
+        //     avatar: avator,
+        //     addToHistory: false
+        // })
 
         try {
             sendLoading.value = true
-            messages.value.push(obj)
+            // messages.value.push(obj)
                 const response = await getFormKey({
                     body: form,
                     input_data: file
@@ -68,7 +68,7 @@ export function useMsg(scrollbar?: any) {
                 console.log(type.value);
                 await streamRes(buildObjPrompt(response.data, form))
         } catch (error) {
-            obj.content = '解析出错'
+            // obj.content = '解析出错'
         } finally {
             sendLoading.value = false
         }