fix(接口测试): 修复binary关联系统文件,关联失败的缺陷

--bug=1037627 --user=王孝刚 【接口测试】接口定义-用例-创建用例-请求体是binary
格式关联系统vue后缀文件,执行结果获取不到文件 https://www.tapd.cn/55049933/s/1481223
This commit is contained in:
wxg0103 2024-03-26 18:26:53 +08:00 committed by 刘瑞斌
parent 25fe3e3795
commit bf3ddfec21
1 changed files with 6 additions and 7 deletions

View File

@ -155,14 +155,13 @@
});
async function handleFileChange(files: MsFileItem[], file?: MsFileItem) {
if (!props.uploadTempFileApi) return;
if (files.length === 0 && file === undefined) {
innerParams.value.binaryBody.file = undefined;
emit('change');
return;
}
try {
if (file?.local && file.file) {
if (file?.local && file.file && props.uploadTempFileApi) {
if (files.length === 0) {
innerParams.value.binaryBody.file = undefined;
emit('change');
return;
}
//
appStore.showLoading();
const res = await props.uploadTempFileApi(file.file);