From c0bf846f82f14f4e359b1636267182ce5ce1b3cf Mon Sep 17 00:00:00 2001 From: Zero Date: Tue, 18 May 2021 09:55:49 +0800 Subject: [PATCH] chore(spug_web): improve code --- spug_web/src/pages/host/Form.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spug_web/src/pages/host/Form.js b/spug_web/src/pages/host/Form.js index 91a75d5..740df94 100644 --- a/spug_web/src/pages/host/Form.js +++ b/spug_web/src/pages/host/Form.js @@ -41,10 +41,8 @@ class ComForm extends React.Component { .then(res => { if (res === 'auth fail') { if (formData.pkey) { - this.setState({loading: false}); message.error('独立密钥认证失败') } else { - this.setState({loading: false}); Modal.confirm({ icon: 'exclamation-circle', title: '首次验证请输入密码', @@ -57,7 +55,10 @@ class ComForm extends React.Component { store.formVisible = false; store.fetchRecords() } - }, () => this.setState({loading: false})) + }) + .finally(() => { + this.setState({loading: false}); + }); }; handleConfirm = (formData) => {