mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-02 12:09:13 +08:00
refactor(接口测试): 优化文件变更后提示消息
Signed-off-by: fit2-zhao <yong.zhao@fit2cloud.com>
This commit is contained in:
parent
4ac4b93d5c
commit
ac9afccb6c
@ -82,15 +82,15 @@ async function checkFile(scenarioFiles) {
|
||||
.slice(0, 1)
|
||||
.arrayBuffer()
|
||||
.then(() => {
|
||||
resolve(false);
|
||||
resolve();
|
||||
})
|
||||
.catch(() => {
|
||||
resolve(true);
|
||||
resolve(item.name);
|
||||
});
|
||||
return func;
|
||||
});
|
||||
if (!scenarioFiles || scenarioFiles.length == 0) {
|
||||
resolve(false);
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -106,9 +106,10 @@ export async function saveScenario(url, scenario, scenarioDefinition, _this, suc
|
||||
}
|
||||
|
||||
let scenarioFiles = getScenarioFiles(scenario);
|
||||
let isUpdated = await checkFile(scenarioFiles);
|
||||
if (isUpdated) {
|
||||
_this.$error(_this.$t('automation.document_validity_msg'));
|
||||
let fileName = await checkFile(scenarioFiles);
|
||||
fileName = fileName || (await checkFile(bodyFiles));
|
||||
if (fileName) {
|
||||
_this.$error('[ ' + fileName + ' ]' + _this.$t('automation.document_validity_msg'));
|
||||
_this.isPreventReClick = false;
|
||||
_this.errorRefresh();
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user