diff --git a/src/components/alert-info/index.tsx b/src/components/alert-info/index.tsx index c8d23f1f..6c2bb29d 100644 --- a/src/components/alert-info/index.tsx +++ b/src/components/alert-info/index.tsx @@ -13,33 +13,34 @@ interface AlertInfoProps { const AlertInfo: React.FC = (props) => { const { message, type, rows = 1, ellipsis, style } = props; - if (!message) { - return null; - } return ( - - - {message} - + <> + {message ? ( + + + {message} + + ) : null} + ); }; diff --git a/src/components/list-input/index.tsx b/src/components/list-input/index.tsx index 428f01aa..a6964448 100644 --- a/src/components/list-input/index.tsx +++ b/src/components/list-input/index.tsx @@ -88,11 +88,11 @@ const ListInput: React.FC = (props) => {
{loading && (
diff --git a/src/pages/playground/components/ground-tts.tsx b/src/pages/playground/components/ground-tts.tsx index 94cb20be..72a602f2 100644 --- a/src/pages/playground/components/ground-tts.tsx +++ b/src/pages/playground/components/ground-tts.tsx @@ -157,7 +157,7 @@ const GroundLeft: React.FC = forwardRef((props, ref) => { console.log('result:', res); - if (res?.error) { + if (res?.status_code !== 200) { setTokenResult({ error: true, errorMessage: @@ -212,14 +212,11 @@ const GroundLeft: React.FC = forwardRef((props, ref) => { const res = await queryModelVoices({ model: value }); - if (res?.error) { + if (res?.status_code !== 200) { setVoiceError({ error: true, errorMessage: - res?.data?.error?.message || - res?.data?.error || - res.error?.detail || - '' + res?.data?.error?.message || res?.data?.error || res?.detail || '' }); setVoiceList([]); return; @@ -248,7 +245,7 @@ const GroundLeft: React.FC = forwardRef((props, ref) => { setVoiceError({ error: true, errorMessage: - res?.error?.message || res?.data?.error || res.error?.detail || '' + res?.error?.message || res?.data?.error || res?.detail || '' }); } setVoiceList([]);