Skip to content

Commit 13d002a

Browse files
committed
fix: The uploaded file image in the conversation is not displayed
1 parent 210e096 commit 13d002a

File tree

1 file changed

+5
-6
lines changed
  • ui/src/components/ai-chat/component/chat-input-operate

1 file changed

+5
-6
lines changed

ui/src/components/ai-chat/component/chat-input-operate/index.vue

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@
293293
</div>
294294
</template>
295295
<script setup lang="ts">
296-
import { ref, computed, onMounted, nextTick, watch, type Ref } from 'vue'
296+
import { ref, computed, onMounted, nextTick, reactive, type Ref } from 'vue'
297297
import { t } from '@/locales'
298298
import Recorder from 'recorder-core'
299299
import TouchChat from './TouchChat.vue'
@@ -429,9 +429,8 @@ const uploadFile = async (file: any, fileList: any) => {
429429
fileList.splice(0, fileList.length)
430430
return
431431
}
432-
fileAllList.value = fileList
433-
console.log(fileAllList.value)
434-
432+
const inner = reactive(file)
433+
fileAllList.value.push(inner)
435434
if (!chatId_context.value) {
436435
const res = await props.openChatId()
437436
chatId_context.value = res
@@ -446,9 +445,9 @@ const uploadFile = async (file: any, fileList: any) => {
446445
)
447446
: chatAPI.postUploadFile(file.raw, chatId_context.value, 'CHAT', uploadLoading)
448447
api.then((ok) => {
449-
file.url = ok.data
448+
inner.url = ok.data
450449
const split_path = ok.data.split('/')
451-
file.file_id = split_path[split_path.length - 1]
450+
inner.file_id = split_path[split_path.length - 1]
452451
})
453452
if (!inputValue.value && uploadImageList.value.length > 0) {
454453
inputValue.value = t('chat.uploadFile.imageMessage')

0 commit comments

Comments
 (0)