修正判断机制

This commit is contained in:
lai
2024-01-08 17:34:48 +08:00
parent 5bf38b1322
commit c98470330b

View File

@@ -352,14 +352,21 @@ function fnModalOk() {
const hide = message.loading({ content: t('common.loading') }); const hide = message.loading({ content: t('common.loading') });
result result
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS&&(typeof res.data.error === 'undefined')) { if (res.code === RESULT_CODE_SUCCESS) {
message.success({ if (res.data?.error || res.data?.affectedRows === 0) {
content: t('common.msgSuccess', { msg: modalState.title }), message.error({
duration: 3, content: `${t('views.configManage.neManage.addFail')}`,
}); duration: 3,
modalState.visibleByEdit = false; });
modalStateFrom.resetFields(); } else {
fnGetList(1); message.success({
content: t('common.msgSuccess', { msg: modalState.title }),
duration: 3,
});
modalState.visibleByEdit = false;
modalStateFrom.resetFields();
fnGetList(1);
}
} else { } else {
message.error({ message.error({
content: `${t('views.configManage.neManage.addFail')}`, content: `${t('views.configManage.neManage.addFail')}`,