From ead72c268780a65f9b41a51690eb7b34c1c5844c Mon Sep 17 00:00:00 2001 From: vapao Date: Wed, 9 Jun 2021 15:13:38 +0800 Subject: [PATCH] fix issues --- spug_web/src/pages/login/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spug_web/src/pages/login/index.js b/spug_web/src/pages/login/index.js index cdc5677..80a4017 100644 --- a/spug_web/src/pages/login/index.js +++ b/spug_web/src/pages/login/index.js @@ -4,7 +4,7 @@ * Released under the AGPL-3.0 License. */ import React, { useState, useEffect } from 'react'; -import { Form, Input, Button, Tabs, Modal } from 'antd'; +import { Form, Input, Button, Tabs, Modal, message } from 'antd'; import { UserOutlined, LockOutlined, CopyrightOutlined, GithubOutlined, MailOutlined } from '@ant-design/icons'; import styles from './login.module.css'; import history from 'libs/history'; @@ -42,8 +42,9 @@ export default function () { }, [counter]) function handleSubmit() { - setLoading(true); const formData = form.getFieldsValue(); + if (codeVisible && !formData.captcha) return message.error('请输入验证码'); + setLoading(true); formData['type'] = loginType; http.post('/api/account/login/', formData) .then(data => {