From be089a072bd55e65fe1d60d450d39067c4085713 Mon Sep 17 00:00:00 2001 From: JustSong Date: Fri, 31 Jan 2025 23:25:32 +0800 Subject: [PATCH] chore: update default theme style --- .../src/components/PasswordResetConfirm.js | 132 ++++++++++++------ .../src/components/PasswordResetForm.js | 110 ++++++++++----- 2 files changed, 159 insertions(+), 83 deletions(-) diff --git a/web/default/src/components/PasswordResetConfirm.js b/web/default/src/components/PasswordResetConfirm.js index d82ae895..82dc6480 100644 --- a/web/default/src/components/PasswordResetConfirm.js +++ b/web/default/src/components/PasswordResetConfirm.js @@ -1,6 +1,21 @@ import React, { useEffect, useState } from 'react'; -import { Button, Form, Grid, Header, Image, Segment } from 'semantic-ui-react'; -import { API, copy, showError, showInfo, showNotice, showSuccess } from '../helpers'; +import { + Button, + Form, + Grid, + Header, + Image, + Card, + Message, +} from 'semantic-ui-react'; +import { + API, + copy, + showError, + showInfo, + showNotice, + showSuccess, +} from '../helpers'; import { useSearchParams } from 'react-router-dom'; const PasswordResetConfirm = () => { @@ -37,7 +52,7 @@ const PasswordResetConfirm = () => { setDisableButton(false); setCountdown(30); } - return () => clearInterval(countdownInterval); + return () => clearInterval(countdownInterval); }, [disableButton, countdown]); async function handleSubmit(e) { @@ -59,55 +74,82 @@ const PasswordResetConfirm = () => { } setLoading(false); } - + return ( -
- 密码重置确认 -
-
- - - {newPassword && ( + + + +
+ + 密码重置确认 +
+
+ { - e.target.select(); - navigator.clipboard.writeText(newPassword); - showNotice(`密码已复制到剪贴板:${newPassword}`); - }} - /> + fluid + icon='mail' + iconPosition='left' + placeholder='邮箱地址' + name='email' + value={email} + readOnly + style={{ marginBottom: '1em' }} + /> + {newPassword && ( + { + e.target.select(); + navigator.clipboard.writeText(newPassword); + showNotice(`密码已复制到剪贴板:${newPassword}`); + }} + /> + )} + + + {newPassword && ( + +

+ 新密码已生成,请点击密码框或上方按钮复制。请及时登录并修改密码! +

+
)} - -
- + +
- ); + ); }; export default PasswordResetConfirm; diff --git a/web/default/src/components/PasswordResetForm.js b/web/default/src/components/PasswordResetForm.js index 435fa70b..6fb6ad83 100644 --- a/web/default/src/components/PasswordResetForm.js +++ b/web/default/src/components/PasswordResetForm.js @@ -1,11 +1,19 @@ import React, { useEffect, useState } from 'react'; -import { Button, Form, Grid, Header, Image, Segment } from 'semantic-ui-react'; +import { + Button, + Form, + Grid, + Header, + Image, + Card, + Message, +} from 'semantic-ui-react'; import { API, showError, showInfo, showSuccess } from '../helpers'; import Turnstile from 'react-turnstile'; const PasswordResetForm = () => { const [inputs, setInputs] = useState({ - email: '' + email: '', }); const { email } = inputs; @@ -42,7 +50,7 @@ const PasswordResetForm = () => { function handleChange(e) { const { name, value } = e.target; - setInputs(inputs => ({ ...inputs, [name]: value })); + setInputs((inputs) => ({ ...inputs, [name]: value })); } async function handleSubmit(e) { @@ -69,42 +77,68 @@ const PasswordResetForm = () => { return ( -
- 密码重置 -
-
- - - {turnstileEnabled ? ( - { - setTurnstileToken(token); - }} + + + +
+ + 密码重置 +
+
+ + - ) : ( - <> - )} - -
-
+ {turnstileEnabled && ( +
+ { + setTurnstileToken(token); + }} + /> +
+ )} + + + +

+ 系统将向您的邮箱发送一封包含重置链接的邮件,请注意查收。 +

+
+ +
);