fix(接口测试): 断言数字类型修复
This commit is contained in:
parent
be206f300c
commit
25952d43a5
|
@ -197,7 +197,7 @@
|
||||||
const expressionFormRef = ref<FormInstance | null>(null);
|
const expressionFormRef = ref<FormInstance | null>(null);
|
||||||
const parseJson = ref<string | Record<string, any>>({});
|
const parseJson = ref<string | Record<string, any>>({});
|
||||||
const isHtml = ref(false);
|
const isHtml = ref(false);
|
||||||
const matchResult = ref<any[]>([]); // 当前匹配结果
|
const matchResult = ref<any[] | string>([]); // 当前匹配结果
|
||||||
const isMatched = ref(false); // 是否执行过匹配
|
const isMatched = ref(false); // 是否执行过匹配
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
|
@ -298,6 +298,8 @@
|
||||||
} else if (typeof results === 'object' && results !== null) {
|
} else if (typeof results === 'object' && results !== null) {
|
||||||
traverseJSONObject(results);
|
traverseJSONObject(results);
|
||||||
matchResult.value = results;
|
matchResult.value = results;
|
||||||
|
} else if (typeof results === 'string' && results.includes('Number(')) {
|
||||||
|
matchResult.value = results.replace(/Number\(([^)]+)\)/g, '$1');
|
||||||
} else {
|
} else {
|
||||||
matchResult.value = results === null || results === false ? `${results}` : results || [];
|
matchResult.value = results === null || results === false ? `${results}` : results || [];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue