fix: API Key Authorization Configuration Model Form render default value (#24963)

This commit is contained in:
17hz 2025-09-02 14:52:05 +08:00 committed by GitHub
parent deea07e905
commit d6b3df8f6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

View File

@ -65,7 +65,10 @@ export const useModelFormSchemas = (
}, [formSchemas, t])
const formValues = useMemo(() => {
let result = {}
let result: any = {}
formSchemas.forEach((schema) => {
result[schema.variable] = schema.default
})
if (credential) {
result = { ...result, __authorization_name__: credential?.credential_name }
if (credentials)
@ -74,7 +77,7 @@ export const useModelFormSchemas = (
if (model)
result = { ...result, __model_name: model?.model, __model_type: model?.model_type }
return result
}, [credentials, credential, model])
}, [credentials, credential, model, formSchemas])
return {
formSchemas: formSchemasWithAuthorizationName,