chore(spug_web): improve code

pull/316/head
Zero 2021-05-18 09:55:49 +08:00
parent 1e4adb8ddf
commit c0bf846f82
1 changed files with 4 additions and 3 deletions

View File

@ -41,10 +41,8 @@ class ComForm extends React.Component {
.then(res => { .then(res => {
if (res === 'auth fail') { if (res === 'auth fail') {
if (formData.pkey) { if (formData.pkey) {
this.setState({loading: false});
message.error('独立密钥认证失败') message.error('独立密钥认证失败')
} else { } else {
this.setState({loading: false});
Modal.confirm({ Modal.confirm({
icon: 'exclamation-circle', icon: 'exclamation-circle',
title: '首次验证请输入密码', title: '首次验证请输入密码',
@ -57,7 +55,10 @@ class ComForm extends React.Component {
store.formVisible = false; store.formVisible = false;
store.fetchRecords() store.fetchRecords()
} }
}, () => this.setState({loading: false})) })
.finally(() => {
this.setState({loading: false});
});
}; };
handleConfirm = (formData) => { handleConfirm = (formData) => {