mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: When there is only a voice file in the answer, an error is reported when reading it aloud.
--bug=1051784 --user=刘瑞斌 【应用编排】回答中只有语音文件的时候,朗读报错 https://www.tapd.cn/57709429/s/1649307
This commit is contained in:
parent
05d06fae11
commit
e9eb7a847e
|
|
@ -79,7 +79,7 @@
|
|||
<audio ref="audioPlayer" v-for="item in audioList" :key="item" controls hidden="hidden"></audio>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { nextTick, onMounted, ref } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { copyClick } from '@/utils/clipboard'
|
||||
import applicationApi from '@/api/application'
|
||||
|
|
@ -173,8 +173,11 @@ const playAnswerText = (text: string) => {
|
|||
// console.log(text)
|
||||
audioPlayerStatus.value = true
|
||||
// 分割成多份
|
||||
audioList.value = text.split(/(<audio[^>]*><\/audio>)/)
|
||||
playAnswerTextPart()
|
||||
audioList.value = text.split(/(<audio[^>]*><\/audio>)/).filter((item) => item.trim().length > 0)
|
||||
nextTick(()=>{
|
||||
// console.log(audioList.value, audioPlayer.value)
|
||||
playAnswerTextPart()
|
||||
})
|
||||
}
|
||||
|
||||
const playAnswerTextPart = () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue