fix(系统设置):导入环境选择其他内容的json格式文件时有错误提示

This commit is contained in:
黎龙鑫 2021-04-23 11:52:50 +08:00 committed by jianxing
parent e0a6707bfb
commit 7acd0a3f88
1 changed files with 16 additions and 12 deletions

View File

@ -89,6 +89,7 @@ export default {
reader.readAsText(file.raw)
reader.onload = (e) => {
let fileString = e.target.result;
try {
JSON.parse(fileString).map(env => {
//projectIdnullprojectId
env.projectId = this.currentProjectId === '' ? null : this.currentProjectId;
@ -97,9 +98,12 @@ export default {
this.$success(this.$t('commons.save_success'));
})
})
} catch (exception) {
this.$warning(this.$t('api_test.api_import.ms_env_import_file_limit'));
}
}
}
}
},
handleExceed() {