fix(项目设置): 修复环境配置导入非json格式报错提示多条问题
--bug=1034499 --user=王旭 【项目设置】环境配置-通用配置-导入变量-导入非json格式报错提示有两条 https://www.tapd.cn/55049933/s/1634418
This commit is contained in:
parent
528ce3b750
commit
2cc45e88cb
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue