feat: add Account ID input field for specific channel type and prevent potential bug with undefined key

This commit is contained in:
JustSong
2025-02-02 19:52:34 +08:00
parent 15c27e4b12
commit 1dc255c219

View File

@@ -207,6 +207,9 @@ const EditChannel = () => {
return; return;
} }
let localInputs = { ...inputs }; let localInputs = { ...inputs };
if (localInputs.key === 'undefined|undefined|undefined') {
localInputs.key = ''; // prevent potential bug
}
if (localInputs.base_url && localInputs.base_url.endsWith('/')) { if (localInputs.base_url && localInputs.base_url.endsWith('/')) {
localInputs.base_url = localInputs.base_url.slice( localInputs.base_url = localInputs.base_url.slice(
0, 0,
@@ -622,6 +625,21 @@ const EditChannel = () => {
/> />
</Form.Field> </Form.Field>
))} ))}
{inputs.type === 37 && (
<Form.Field>
<Form.Input
label='Account ID'
name='user_id'
required
placeholder={
'请输入 Account ID例如d8d7c61dbc334c32d3ced580e4bf42b4'
}
onChange={handleConfigChange}
value={config.user_id}
autoComplete=''
/>
</Form.Field>
)}
{inputs.type !== 33 && !isEdit && ( {inputs.type !== 33 && !isEdit && (
<Form.Checkbox <Form.Checkbox
checked={batch} checked={batch}