whistle.mock-plugins 1.1.1-dev.10 → 1.1.1-dev.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -172,6 +172,7 @@ const InterfaceManagement = () => {
|
|
|
172
172
|
|
|
173
173
|
setInterfaces(processedInterfaces);
|
|
174
174
|
console.log('处理后的接口列表:', processedInterfaces);
|
|
175
|
+
console.log('接口分组信息:', processedInterfaces.map(item => ({ id: item.id, name: item.name, group: item.group })));
|
|
175
176
|
|
|
176
177
|
// 提取并更新分组列表
|
|
177
178
|
updateGroups(processedInterfaces);
|
|
@@ -250,7 +251,8 @@ const InterfaceManagement = () => {
|
|
|
250
251
|
activeResponseId: defaultResponseId,
|
|
251
252
|
httpMethod: 'ALL',
|
|
252
253
|
headerItems: [], // 初始化为空数组
|
|
253
|
-
paramMatchers: [] // 初始化为空数组
|
|
254
|
+
paramMatchers: [], // 初始化为空数组
|
|
255
|
+
group: undefined // 确保分组字段为undefined,而不是空字符串
|
|
254
256
|
});
|
|
255
257
|
|
|
256
258
|
setCurrentResponseId(defaultResponseId);
|
|
@@ -300,7 +302,7 @@ const InterfaceManagement = () => {
|
|
|
300
302
|
// 设置表单值
|
|
301
303
|
form.setFieldsValue({
|
|
302
304
|
name: record.name,
|
|
303
|
-
group: record.group ||
|
|
305
|
+
group: record.group || undefined, // 使用undefined而不是空字符串
|
|
304
306
|
pattern: record.urlPattern,
|
|
305
307
|
proxyType: record.proxyType || 'response',
|
|
306
308
|
statusCode: (record.httpStatus || record.statusCode || 200).toString(),
|
|
@@ -314,6 +316,8 @@ const InterfaceManagement = () => {
|
|
|
314
316
|
responseDelay: record.responseDelay ? record.responseDelay.toString() : '0'
|
|
315
317
|
});
|
|
316
318
|
|
|
319
|
+
console.log('编辑接口时设置的分组值:', record.group);
|
|
320
|
+
|
|
317
321
|
setCurrentResponseId(activeResponseId);
|
|
318
322
|
setEditingInterface(record);
|
|
319
323
|
setModalVisible(true);
|
|
@@ -376,7 +380,7 @@ const InterfaceManagement = () => {
|
|
|
376
380
|
// 构建接口数据
|
|
377
381
|
const interfaceData = {
|
|
378
382
|
name: values.name,
|
|
379
|
-
group: values.group,
|
|
383
|
+
group: values.group || '', // 确保group不为undefined
|
|
380
384
|
urlPattern: values.pattern,
|
|
381
385
|
proxyType: values.proxyType,
|
|
382
386
|
featureId: selectedFeatureId,
|
|
@@ -389,6 +393,8 @@ const InterfaceManagement = () => {
|
|
|
389
393
|
active: true
|
|
390
394
|
};
|
|
391
395
|
|
|
396
|
+
console.log('提交的分组值:', values.group);
|
|
397
|
+
|
|
392
398
|
// 根据代理类型添加不同字段
|
|
393
399
|
if (values.proxyType === 'redirect' || values.proxyType === 'url_redirect') {
|
|
394
400
|
interfaceData.targetUrl = values.targetUrl;
|
|
@@ -1157,8 +1163,7 @@ const InterfaceManagement = () => {
|
|
|
1157
1163
|
placeholder="选择或创建分组"
|
|
1158
1164
|
showSearch
|
|
1159
1165
|
allowClear
|
|
1160
|
-
|
|
1161
|
-
tokenSeparators={[',']}
|
|
1166
|
+
style={{ width: '100%' }}
|
|
1162
1167
|
onInputKeyDown={(e) => {
|
|
1163
1168
|
// 防止回车键提交表单
|
|
1164
1169
|
if (e.key === 'Enter') {
|