mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-10-30 01:10:50 +08:00
feat: 完善 OTG UAC 音频支持
This commit is contained in:
@@ -55,6 +55,14 @@ function getToastKey(endpoint: string, config?: ApiRequestConfig): string {
|
||||
|
||||
function getErrorMessage(data: unknown, fallback: string): string {
|
||||
if (data && typeof data === 'object') {
|
||||
const code = (data as any).code
|
||||
const keyByCode: Record<string, string> = {
|
||||
MSD_MEDIUM_REMOVAL_PREVENTED: 'msd.errors.mediumRemovalPrevented',
|
||||
MSD_DISCONNECT_FAILED: 'msd.errors.disconnectFailed',
|
||||
}
|
||||
const key = typeof code === 'string' ? keyByCode[code] : undefined
|
||||
if (key && hasTranslation(key)) return t(key)
|
||||
|
||||
const message = (data as any).message
|
||||
if (typeof message === 'string' && message.trim()) return localizeBackendErrorMessage(message)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user