fix: 修复供应商管理弹窗交互问题并去掉 API Key 脱敏
- Dialog 设置 lazy={false} 修复首次打开编辑弹窗表单为空
- API Key 改为普通字段(前端去掉 password 类型,后端去掉掩码逻辑)
- 删除模型编辑弹窗中的统一模型 ID 字段
- 简化 ProviderService.Get 签名(去掉 maskKey 参数)
- 删除 domain 和 config 层的 MaskAPIKey() 方法
- 更新前后端测试(107 单元测试 + 16 E2E 全部通过)
- 同步 delta spec 到主 spec
This commit is contained in:
@@ -533,8 +533,7 @@ func TestConversion_ProviderWithProtocol(t *testing.T) {
|
||||
|
||||
var created map[string]any
|
||||
json.Unmarshal(w.Body.Bytes(), &created)
|
||||
// API Key 被掩码
|
||||
assert.Contains(t, created["api_key"], "***")
|
||||
assert.Equal(t, "sk-test", created["api_key"])
|
||||
|
||||
// 获取时应包含 protocol
|
||||
w = httptest.NewRecorder()
|
||||
|
||||
@@ -103,7 +103,7 @@ func TestOpenAI_CompleteFlow(t *testing.T) {
|
||||
var providers []domain.Provider
|
||||
json.Unmarshal(w.Body.Bytes(), &providers)
|
||||
assert.Len(t, providers, 1)
|
||||
assert.Contains(t, providers[0].APIKey, "***") // 已掩码
|
||||
assert.Equal(t, "sk-test-key", providers[0].APIKey)
|
||||
|
||||
// 4. 列出 Model
|
||||
w = httptest.NewRecorder()
|
||||
|
||||
Reference in New Issue
Block a user