diff --git a/api-test/frontend/src/business/automation/scenario/variable/VariableImport.vue b/api-test/frontend/src/business/automation/scenario/variable/VariableImport.vue index d695562212..40340293dd 100644 --- a/api-test/frontend/src/business/automation/scenario/variable/VariableImport.vue +++ b/api-test/frontend/src/business/automation/scenario/variable/VariableImport.vue @@ -98,7 +98,9 @@ export default { save() { if (this.uploadFiles.length > 0) { for (let i = 0; i < this.uploadFiles.length; i++) { - this.uploadValidate(this.uploadFiles[i]); + if (this.uploadValidate(this.uploadFiles[i])) { + return; + } let file = this.uploadFiles[i]; if (!file) { continue; @@ -139,10 +141,13 @@ export default { const extension = file.name.substring(file.name.lastIndexOf('.') + 1); if (!(extension === 'json')) { this.$warning(this.$t('api_test.api_import.ms_env_import_file_limit')); + return true; } if (file.size / 1024 / 1024 > 20) { this.$warning(this.$t('api_test.api_import.file_size_limit')); + return true; } + return false; }, open() { this.dialogVisible = true; diff --git a/framework/sdk-parent/frontend/src/components/environment/VariableImport.vue b/framework/sdk-parent/frontend/src/components/environment/VariableImport.vue index 8f887c9ac2..f5a168fd39 100644 --- a/framework/sdk-parent/frontend/src/components/environment/VariableImport.vue +++ b/framework/sdk-parent/frontend/src/components/environment/VariableImport.vue @@ -96,7 +96,9 @@ export default { save() { if (this.uploadFiles.length > 0) { for (let i = 0; i < this.uploadFiles.length; i++) { - this.uploadValidate(this.uploadFiles[i]); + if(this.uploadValidate(this.uploadFiles[i])){ + return; + } let file = this.uploadFiles[i]; if (!file) { continue; @@ -138,10 +140,13 @@ export default { const extension = file.name.substring(file.name.lastIndexOf('.') + 1); if (!(extension === 'json')) { this.$warning(this.$t('api_test.api_import.ms_env_import_file_limit')); + return true; } if (file.size / 1024 / 1024 > 20) { this.$warning(this.$t('api_test.api_import.file_size_limit')); + return true; } + return false; }, open() { this.dialogVisible = true; diff --git a/framework/sdk-parent/frontend/src/components/environment/commons/variable/VariableImport.vue b/framework/sdk-parent/frontend/src/components/environment/commons/variable/VariableImport.vue index 73a39518a1..47694d7997 100644 --- a/framework/sdk-parent/frontend/src/components/environment/commons/variable/VariableImport.vue +++ b/framework/sdk-parent/frontend/src/components/environment/commons/variable/VariableImport.vue @@ -94,7 +94,9 @@ export default { save() { if (this.uploadFiles.length > 0) { for (let i = 0; i < this.uploadFiles.length; i++) { - this.uploadValidate(this.uploadFiles[i]); + if(this.uploadValidate(this.uploadFiles[i])){ + return; + } let file = this.uploadFiles[i]; if (!file) { continue; @@ -136,10 +138,13 @@ export default { const extension = file.name.substring(file.name.lastIndexOf('.') + 1); if (!(extension === 'json')) { this.$warning(this.$t('api_test.api_import.ms_env_import_file_limit')); + return true; } if (file.size / 1024 / 1024 > 20) { this.$warning(this.$t('api_test.api_import.file_size_limit')); + return true; } + return false; }, open() { this.dialogVisible = true; diff --git a/project-management/frontend/src/business/menu/environment/EnvironmentImport.vue b/project-management/frontend/src/business/menu/environment/EnvironmentImport.vue index 7057d0f70e..94e93e0942 100644 --- a/project-management/frontend/src/business/menu/environment/EnvironmentImport.vue +++ b/project-management/frontend/src/business/menu/environment/EnvironmentImport.vue @@ -93,7 +93,9 @@ export default { save() { if (this.uploadFiles.length > 0) { for (let i = 0; i < this.uploadFiles.length; i++) { - this.uploadValidate(this.uploadFiles[i]); + if (this.uploadValidate(this.uploadFiles[i])) { + return; + } let file = this.uploadFiles[i]; if (!file) { continue; @@ -133,10 +135,13 @@ export default { const extension = file.name.substring(file.name.lastIndexOf('.') + 1); if (!(extension === 'json')) { this.$warning(this.$t('api_test.api_import.ms_env_import_file_limit')); + return true; } if (file.size / 1024 / 1024 > this.uploadSize) { this.$warning(this.$t('api_test.api_import.file_size_limit', {size: this.uploadSize})); + return true } + return false; }, open() { this.dialogVisible = true; diff --git a/system-setting/frontend/src/business/workspace/environment/EnvironmentImport.vue b/system-setting/frontend/src/business/workspace/environment/EnvironmentImport.vue index 46cd4e0568..c439945fa0 100644 --- a/system-setting/frontend/src/business/workspace/environment/EnvironmentImport.vue +++ b/system-setting/frontend/src/business/workspace/environment/EnvironmentImport.vue @@ -86,7 +86,9 @@ export default { save() { if (this.uploadFiles.length > 0) { for (let i = 0; i < this.uploadFiles.length; i++) { - this.uploadValidate(this.uploadFiles[i]); + if (this.uploadValidate(this.uploadFiles[i])) { + return; + } let file = this.uploadFiles[i]; if (!file) { continue; @@ -133,10 +135,13 @@ export default { const extension = file.name.substring(file.name.lastIndexOf('.') + 1); if (!(extension === 'json')) { this.$warning(this.$t('api_test.api_import.ms_env_import_file_limit')); + return true; } if (file.size / 1024 / 1024 > this.uploadSize) { this.$warning(this.$t('api_test.api_import.file_size_limit', {size: this.uploadSize})); + return true; } + return false; }, open() { this.dialogVisible = true; diff --git a/system-setting/frontend/src/business/workspace/environment/WsEnvironmentImport.vue b/system-setting/frontend/src/business/workspace/environment/WsEnvironmentImport.vue index f90ffda7b2..3ec4357f5c 100644 --- a/system-setting/frontend/src/business/workspace/environment/WsEnvironmentImport.vue +++ b/system-setting/frontend/src/business/workspace/environment/WsEnvironmentImport.vue @@ -81,7 +81,9 @@ export default { save() { if (this.uploadFiles.length > 0) { for (let i = 0; i < this.uploadFiles.length; i++) { - this.uploadValidate(this.uploadFiles[i]); + if (this.uploadValidate(this.uploadFiles[i])) { + return; + } let file = this.uploadFiles[i]; if (!file) { continue; @@ -118,10 +120,13 @@ export default { const extension = file.name.substring(file.name.lastIndexOf('.') + 1); if (!(extension === 'json')) { this.$warning(this.$t('api_test.api_import.ms_env_import_file_limit')); + return true; } if (file.size / 1024 / 1024 > 20) { this.$warning(this.$t('api_test.api_import.file_size_limit')); + return true; } + return false; }, open() { this.dialogVisible = true;