diff --git a/web/src/components/LoginForm.js b/web/src/components/LoginForm.js
index 71ffc15f..110dad46 100644
--- a/web/src/components/LoginForm.js
+++ b/web/src/components/LoginForm.js
@@ -1,38 +1,25 @@
import React, { useContext, useEffect, useState } from 'react';
-import {
- Button,
- Divider,
- Form,
- Grid,
- Header,
- Image,
- Message,
- Modal,
- Segment,
-} from 'semantic-ui-react';
+import { Button, Divider, Form, Grid, Header, Image, Message, Modal, Segment } from 'semantic-ui-react';
import { Link, useNavigate, useSearchParams } from 'react-router-dom';
import { UserContext } from '../context/User';
-import { API, getLogo, showError, showSuccess, showInfo } from '../helpers';
+import { API, getLogo, showError, showSuccess } from '../helpers';
const LoginForm = () => {
const [inputs, setInputs] = useState({
username: '',
password: '',
- wechat_verification_code: '',
+ wechat_verification_code: ''
});
const [searchParams, setSearchParams] = useSearchParams();
const [submitted, setSubmitted] = useState(false);
const { username, password } = inputs;
const [userState, userDispatch] = useContext(UserContext);
let navigate = useNavigate();
- function handleNavigateTo(url) {
- navigate(url);
- }
const [status, setStatus] = useState({});
const logo = getLogo();
useEffect(() => {
- if (searchParams.get("expired")) {
+ if (searchParams.get('expired')) {
showError('未登录或登录已过期,请重新登录!');
}
let status = localStorage.getItem('status');
@@ -80,7 +67,7 @@ const LoginForm = () => {
if (username && password) {
const res = await API.post(`/api/user/login`, {
username,
- password,
+ password
});
const { success, message, data } = res.data;
if (success) {
@@ -95,44 +82,46 @@ const LoginForm = () => {
}
return (
-
+
-
+
-
-
-
+ 忘记密码?
+
+ 点击重置
+
+ ; 没有账户?
+
+ 点击注册
+
{status.github_oauth || status.wechat_login ? (
<>
@@ -140,8 +129,8 @@ const LoginForm = () => {
{status.github_oauth ? (
) : (
@@ -150,8 +139,8 @@ const LoginForm = () => {
{status.wechat_login ? (
) : (
@@ -175,18 +164,18 @@ const LoginForm = () => {
微信扫码关注公众号,输入「验证码」获取验证码(三分钟内有效)
-
-
-
+ 已有账户?
+
+ 点击登录
+