From 45d10aa3df959c49e4715eafa93f0b069ecd91af Mon Sep 17 00:00:00 2001 From: JustSong Date: Fri, 31 Jan 2025 23:24:11 +0800 Subject: [PATCH] chore: update default theme style --- web/default/src/components/LoginForm.js | 268 +++++++++++---------- web/default/src/components/RegisterForm.js | 223 ++++++++++------- 2 files changed, 281 insertions(+), 210 deletions(-) diff --git a/web/default/src/components/LoginForm.js b/web/default/src/components/LoginForm.js index 71566ef8..4b85faad 100644 --- a/web/default/src/components/LoginForm.js +++ b/web/default/src/components/LoginForm.js @@ -1,5 +1,16 @@ 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, + Card, +} from 'semantic-ui-react'; import { Link, useNavigate, useSearchParams } from 'react-router-dom'; import { UserContext } from '../context/User'; import { API, getLogo, showError, showSuccess, showWarning } from '../helpers'; @@ -10,7 +21,7 @@ const LoginForm = () => { const [inputs, setInputs] = useState({ username: '', password: '', - wechat_verification_code: '' + wechat_verification_code: '', }); const [searchParams, setSearchParams] = useSearchParams(); const [submitted, setSubmitted] = useState(false); @@ -63,7 +74,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) { @@ -86,129 +97,140 @@ const LoginForm = () => { return ( -
- 用户登录 -
-
- - - - - -
- - 忘记密码? - - 点击重置 - - ; 没有账户? - - 点击注册 - - - {status.github_oauth || status.wechat_login || status.lark_client_id ? ( - <> - Or -
- {status.github_oauth ? ( -
- - ) : ( - <> - )} - setShowWeChatLoginModal(false)} - onOpen={() => setShowWeChatLoginModal(true)} - open={showWeChatLoginModal} - size={'mini'} + - - - -
-

- 微信扫码关注公众号,输入「验证码」获取验证码(三分钟内有效) -

+ + +
+ + 用户登录 +
+
+
+ + + + + + + +
+
+ 忘记密码? + + 点击重置 + +
+
+ 没有账户? + + 点击注册 + +
-
- - - - - - + 使用其他方式登录 +
+
+ {status.github_oauth && ( +
+ + )} +
+ ); diff --git a/web/default/src/components/RegisterForm.js b/web/default/src/components/RegisterForm.js index f91d6da0..09dc1512 100644 --- a/web/default/src/components/RegisterForm.js +++ b/web/default/src/components/RegisterForm.js @@ -1,5 +1,15 @@ import React, { useEffect, useState } from 'react'; -import { Button, Form, Grid, Header, Image, Message, Segment } from 'semantic-ui-react'; +import { + Button, + Form, + Grid, + Header, + Image, + Message, + Segment, + Card, + Divider, +} from 'semantic-ui-react'; import { Link, useNavigate } from 'react-router-dom'; import { API, getLogo, showError, showInfo, showSuccess } from '../helpers'; import Turnstile from 'react-turnstile'; @@ -10,7 +20,7 @@ const RegisterForm = () => { password: '', password2: '', email: '', - verification_code: '' + verification_code: '', }); const { username, password, password2 } = inputs; const [showEmailVerification, setShowEmailVerification] = useState(false); @@ -100,92 +110,131 @@ const RegisterForm = () => { return ( -
- 新用户注册 -
-
- - - - - {showEmailVerification ? ( - <> - - 获取验证码 - - } - /> - - - ) : ( - <> - )} - {turnstileEnabled ? ( - { - setTurnstileToken(token); - }} + + + +
+ + 新用户注册 +
+
+ + - ) : ( - <> - )} - -
-
- - 已有账户? - - 点击登录 - - + + + + {showEmailVerification && ( + <> + + 获取验证码 + + } + style={{ marginBottom: '1em' }} + /> + + + )} + + {turnstileEnabled && ( +
+ { + setTurnstileToken(token); + }} + /> +
+ )} + + + + + + +
+ 已有账户? + + 点击登录 + +
+
+ +
);