diff --git a/rds-console/console-ui/src/views/system/config/index.vue b/rds-console/console-ui/src/views/system/config/index.vue index 2f6e11f8db7f9446bd1c6eb8fd780dc17a90a4d4..6de7de7d2272b8a0f794c6aed318e9dcbac4c949 100644 --- a/rds-console/console-ui/src/views/system/config/index.vue +++ b/rds-console/console-ui/src/views/system/config/index.vue @@ -295,19 +295,11 @@ export default { submitForm: function() { this.$refs['form'].validate(valid => { if (valid) { - if (this.form.configId !== undefined) { - updateConfig(this.form).then(response => { - this.$modal.msgSuccess(this.$t('dialog.editSuccess')) - this.open = false - this.getList() - }) - } else { - addConfig(this.form).then(response => { - this.$modal.msgSuccess(this.$t('dialog.addSuccess')) - this.open = false - this.getList() - }) - } + (!this.form.configId ? addConfig(this.form) : updateConfig(this.form)).then(response => { + this.$modal.msgSuccess(!this.form.configId ? this.$t('dialog.addSuccess') : this.$t('dialog.editSuccess')) + this.open = false + this.getList() + }) } }) },