diff --git a/config.js b/config.js index 502066f..b005721 100644 --- a/config.js +++ b/config.js @@ -1,6 +1,6 @@ export default { - baseUrl: 'https://fw.rc.qingdao.gov.cn/rgpp-api/api', // 内网 - // baseUrl: 'https://qd.zhaopinzao8dian.com/api', // 测试 + // baseUrl: 'https://fw.rc.qingdao.gov.cn/rgpp-api/api', // 内网 + baseUrl: 'https://qd.zhaopinzao8dian.com/api', // 测试 // baseUrl: 'http://192.168.3.29:8081', // baseUrl: 'http://10.213.6.207:19010/api', // 语音转文字 diff --git a/pages/chat/components/ai-paging.vue b/pages/chat/components/ai-paging.vue index 585eb7c..81887db 100644 --- a/pages/chat/components/ai-paging.vue +++ b/pages/chat/components/ai-paging.vue @@ -241,7 +241,7 @@ - + @@ -282,7 +282,7 @@ const emit = defineEmits(['onConfirm']); const { messages, isTyping, textInput, chatSessionID } = storeToRefs(useChatGroupDBStore()); import successIcon from '@/static/icon/success.png'; import useUserStore from '@/stores/useUserStore'; -const {isMachineEnv} = storeToRefs(useUserStore()); +const { isMachineEnv } = storeToRefs(useUserStore()); // hook // 语音识别 const { @@ -463,7 +463,14 @@ function getGuess() { } function isImage(type) { - return new RegExp('image').test(type); + if (!type || typeof type !== 'string') return false; + const imageTypes = [ + 'jpg', 'jpeg', 'png', 'gif', 'bmp', + 'webp', 'svg', 'tiff', 'tif', 'ico', + 'apng', 'avif', 'heic', 'heif', 'jfif' + ]; + const lowerType = type.toLowerCase(); + return imageTypes.includes(lowerType); } function isFile(type) { @@ -543,6 +550,31 @@ function getUploadFile(type = 'camera') { }); } +const handleFileSend = (rows)=>{ + filesList.value = [] + try { + rows.map(item=>{ + if(isImage(item.fileSuffix)){ + filesList.value.push({ + url: item.fileUrl, + type: item.fileSuffix, + name: item.fileName, + }); + }else{ + filesList.value.push({ + url: item.fileUrl, + type: item.fileSuffix, + name: item.fileName, + }); + } + }) + textInput.value = state.uploadFileTips; + + } catch (error) { + console.log(error) + } +} + const tipsPermisson = () => { uni.showToast({ title: '需要授权麦克风权限才能使用语音功能', @@ -604,7 +636,7 @@ function changeVoice() { } function changeShowFile() { - if(isMachineEnv){ + if(isMachineEnv.value){ qrcodeRef.value?.open() return } diff --git a/pages/chat/components/fileIcon.vue b/pages/chat/components/fileIcon.vue index 888c53b..a49cce1 100644 --- a/pages/chat/components/fileIcon.vue +++ b/pages/chat/components/fileIcon.vue @@ -1,5 +1,5 @@