mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-17 16:43:54 +00:00
feat: add Account ID input field for specific channel type and prevent potential bug with undefined key
This commit is contained in:
@@ -207,6 +207,9 @@ const EditChannel = () => {
|
||||
return;
|
||||
}
|
||||
let localInputs = { ...inputs };
|
||||
if (localInputs.key === 'undefined|undefined|undefined') {
|
||||
localInputs.key = ''; // prevent potential bug
|
||||
}
|
||||
if (localInputs.base_url && localInputs.base_url.endsWith('/')) {
|
||||
localInputs.base_url = localInputs.base_url.slice(
|
||||
0,
|
||||
@@ -622,6 +625,21 @@ const EditChannel = () => {
|
||||
/>
|
||||
</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 && (
|
||||
<Form.Checkbox
|
||||
checked={batch}
|
||||
|
Reference in New Issue
Block a user