fix: Unfiltered special characters in voice playback (#2777)

This commit is contained in:
shaohuzhang1 2025-04-02 16:12:17 +08:00 committed by GitHub
parent 27bc01d442
commit 74d10b61bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -99,7 +99,7 @@
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { nextTick, onMounted, ref } from 'vue' import { nextTick, onMounted, ref, onBeforeUnmount } from 'vue'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import { copyClick } from '@/utils/clipboard' import { copyClick } from '@/utils/clipboard'
import applicationApi from '@/api/application' import applicationApi from '@/api/application'
@ -489,7 +489,7 @@ class AudioManage {
// text // text
text = markdownToPlainText(text) text = markdownToPlainText(text)
const split = smartSplit( const split = smartSplit(
props.data.answer_text, text,
{ {
0: 20, 0: 20,
1: 50, 1: 50,
@ -526,6 +526,11 @@ onMounted(() => {
} }
}) })
}) })
onBeforeUnmount(() => {
if (audioManage.value) {
audioManage.value.pause()
}
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@media only screen and (max-width: 430px) { @media only screen and (max-width: 430px) {