|
@@ -6,7 +6,7 @@ import { useSearchParams } from 'react-router-dom';
|
|
const PasswordResetConfirm = () => {
|
|
const PasswordResetConfirm = () => {
|
|
const [inputs, setInputs] = useState({
|
|
const [inputs, setInputs] = useState({
|
|
email: '',
|
|
email: '',
|
|
- token: ''
|
|
|
|
|
|
+ token: '',
|
|
});
|
|
});
|
|
const { email, token } = inputs;
|
|
const { email, token } = inputs;
|
|
|
|
|
|
@@ -15,11 +15,11 @@ const PasswordResetConfirm = () => {
|
|
const [searchParams, setSearchParams] = useSearchParams();
|
|
const [searchParams, setSearchParams] = useSearchParams();
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
let token = searchParams.get('token');
|
|
let token = searchParams.get('token');
|
|
- let email = searchParams.get('email')
|
|
|
|
|
|
+ let email = searchParams.get('email');
|
|
setInputs({
|
|
setInputs({
|
|
token,
|
|
token,
|
|
- email
|
|
|
|
- })
|
|
|
|
|
|
+ email,
|
|
|
|
+ });
|
|
}, []);
|
|
}, []);
|
|
|
|
|
|
async function handleSubmit(e) {
|
|
async function handleSubmit(e) {
|
|
@@ -27,7 +27,7 @@ const PasswordResetConfirm = () => {
|
|
setLoading(true);
|
|
setLoading(true);
|
|
const res = await API.post(`/api/user/reset`, {
|
|
const res = await API.post(`/api/user/reset`, {
|
|
email,
|
|
email,
|
|
- token
|
|
|
|
|
|
+ token,
|
|
});
|
|
});
|
|
const { success, message } = res.data;
|
|
const { success, message } = res.data;
|
|
if (success) {
|
|
if (success) {
|
|
@@ -43,17 +43,17 @@ const PasswordResetConfirm = () => {
|
|
return (
|
|
return (
|
|
<Grid textAlign='center' style={{ marginTop: '48px' }}>
|
|
<Grid textAlign='center' style={{ marginTop: '48px' }}>
|
|
<Grid.Column style={{ maxWidth: 450 }}>
|
|
<Grid.Column style={{ maxWidth: 450 }}>
|
|
- <Header as='h2' color='teal' textAlign='center'>
|
|
|
|
|
|
+ <Header as='h2' color='telegram' textAlign='center'>
|
|
<Image src='/logo.png' /> 密码重置确认
|
|
<Image src='/logo.png' /> 密码重置确认
|
|
</Header>
|
|
</Header>
|
|
<Form size='large'>
|
|
<Form size='large'>
|
|
<Segment>
|
|
<Segment>
|
|
<Form.Input
|
|
<Form.Input
|
|
fluid
|
|
fluid
|
|
- icon="mail"
|
|
|
|
- iconPosition="left"
|
|
|
|
- placeholder="邮箱地址"
|
|
|
|
- name="email"
|
|
|
|
|
|
+ icon='mail'
|
|
|
|
+ iconPosition='left'
|
|
|
|
+ placeholder='邮箱地址'
|
|
|
|
+ name='email'
|
|
value={email}
|
|
value={email}
|
|
readOnly
|
|
readOnly
|
|
/>
|
|
/>
|