fix: 补齐前端生成物忽略并消除构建告警
统一 Git、ESLint、Prettier 对测试和构建生成物的忽略规则,避免本地产物导致 frontend-build 失败。 补齐表单 effect 依赖,移除无关告警,让前端构建链路恢复稳定。
This commit is contained in:
@@ -23,18 +23,16 @@ export function ModelForm({ open, model, providerId, providers, onSave, onCancel
|
||||
const [form] = Form.useForm()
|
||||
const isEdit = !!model
|
||||
|
||||
// 当弹窗打开或model变化时,设置表单值
|
||||
// 当弹窗打开或 model 变化时,同步表单初始值。
|
||||
useEffect(() => {
|
||||
if (open && form) {
|
||||
if (model) {
|
||||
// 编辑模式:设置现有值
|
||||
form.setFieldsValue({
|
||||
providerId: model.providerId,
|
||||
modelName: model.modelName,
|
||||
enabled: model.enabled,
|
||||
})
|
||||
} else {
|
||||
// 新增模式:重置表单并设置默认providerId
|
||||
form.reset()
|
||||
form.setFieldsValue({
|
||||
providerId,
|
||||
@@ -42,7 +40,7 @@ export function ModelForm({ open, model, providerId, providers, onSave, onCancel
|
||||
})
|
||||
}
|
||||
}
|
||||
}, [open, model, providerId]) // 移除form依赖,避免循环
|
||||
}, [form, open, model, providerId])
|
||||
|
||||
const handleSubmit = (context: SubmitContext) => {
|
||||
if (context.validateResult === true && form) {
|
||||
|
||||
@@ -40,7 +40,7 @@ export function ProviderForm({ open, provider, onSave, onCancel, loading }: Prov
|
||||
form.setFieldsValue({ enabled: true, protocol: 'openai' })
|
||||
}
|
||||
}
|
||||
}, [open, provider])
|
||||
}, [form, open, provider])
|
||||
|
||||
const handleSubmit = (context: SubmitContext) => {
|
||||
if (context.validateResult === true && form) {
|
||||
|
||||
Reference in New Issue
Block a user