update packages

This commit is contained in:
2023-12-30 11:44:43 +08:00
parent 5c52ae5ab2
commit cb9554626c
5 changed files with 297 additions and 458 deletions

View File

@@ -312,7 +312,6 @@ async function getOutputDevice() {
// 请保留此代码以确保用户授权访问设备
audio: true,
})
const list = await navigator.mediaDevices.enumerateDevices()
deviceList.value = list.filter((device) => device.kind === 'audiooutput').map((d) => ({ label: d.label, value: d.deviceId }))

View File

@@ -271,13 +271,14 @@ function speakFromAPI(text: string) {
}
isSpeaking.value = true
isApiAudioLoading.value = true
const url = `${settings.value.voiceAPISchemeType == 'https' ? 'https' : FETCH_API + 'http'}://${settings.value.voiceAPI
let url = `${settings.value.voiceAPISchemeType == 'https' ? 'https' : FETCH_API + 'http'}://${settings.value.voiceAPI
.trim()
.replace(/^(?:https?:\/\/)/, '')
.replace(/\{\{\s*text\s*\}\}/, encodeURIComponent(text))}`
const tempURL = new URL(url)
if (isVtsuruVoiceAPI.value) {
tempURL.searchParams.set('vtsuruId', accountInfo.value?.id.toString() ?? '-1')
url = tempURL.toString()
}
if (isVtsuruVoiceAPI.value && splitter.countGraphemes(tempURL.searchParams.get('text') ?? '') > 50) {
message.error('本站提供的测试接口字数不允许超过 100 字. 内容: [' + tempURL.searchParams.get('text') + ']')