chore: update style
This commit is contained in:
parent
0dc96fc379
commit
86ebb66e46
@ -483,7 +483,7 @@ func DeleteSelf(c *gin.Context) {
|
|||||||
if user.Role == common.RoleRootUser {
|
if user.Role == common.RoleRootUser {
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
"success": false,
|
"success": false,
|
||||||
"message": "无权删除超级管理员",
|
"message": "不能删除超级管理员账户",
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
import React, { useEffect, useState, useContext } from 'react';
|
import React, { useContext, useEffect, useState } from 'react';
|
||||||
import { Button, Divider, Form, Header, Image, Message, Modal, Label } from 'semantic-ui-react';
|
import { Button, Divider, Form, Header, Image, Message, Modal } from 'semantic-ui-react';
|
||||||
import { Link, useNavigate } from 'react-router-dom';
|
import { Link, useNavigate } from 'react-router-dom';
|
||||||
import { API, copy, showError, showInfo, showNotice, showSuccess } from '../helpers';
|
import { API, copy, showError, showInfo, showNotice, showSuccess } from '../helpers';
|
||||||
import Turnstile from 'react-turnstile';
|
import Turnstile from 'react-turnstile';
|
||||||
import { UserContext } from '../context/User';
|
import { UserContext } from '../context/User';
|
||||||
|
|
||||||
const PersonalSetting = () => {
|
const PersonalSetting = () => {
|
||||||
const [userDispatch] = useContext(UserContext);
|
const [userState, userDispatch] = useContext(UserContext);
|
||||||
let navigate = useNavigate();
|
let navigate = useNavigate();
|
||||||
|
|
||||||
const [inputs, setInputs] = useState({
|
const [inputs, setInputs] = useState({
|
||||||
wechat_verification_code: '',
|
wechat_verification_code: '',
|
||||||
email_verification_code: '',
|
email_verification_code: '',
|
||||||
email: '',
|
email: '',
|
||||||
self_account_deletion_confirmation: '',
|
self_account_deletion_confirmation: ''
|
||||||
});
|
});
|
||||||
const [status, setStatus] = useState({});
|
const [status, setStatus] = useState({});
|
||||||
const [showWeChatBindModal, setShowWeChatBindModal] = useState(false);
|
const [showWeChatBindModal, setShowWeChatBindModal] = useState(false);
|
||||||
@ -64,8 +64,8 @@ const PersonalSetting = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const deleteAccount = async () => {
|
const deleteAccount = async () => {
|
||||||
if (inputs.self_account_deletion_confirmation !== 'CONFIRM') {
|
if (inputs.self_account_deletion_confirmation !== userState.user.username) {
|
||||||
showError('请确认您要删除账户!');
|
showError('请输入你的账户名以确认删除!');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ const PersonalSetting = () => {
|
|||||||
} else {
|
} else {
|
||||||
showError(message);
|
showError(message);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
const bindWeChat = async () => {
|
const bindWeChat = async () => {
|
||||||
if (inputs.wechat_verification_code === '') return;
|
if (inputs.wechat_verification_code === '') return;
|
||||||
@ -151,7 +151,7 @@ const PersonalSetting = () => {
|
|||||||
<Button onClick={getAffLink}>复制邀请链接</Button>
|
<Button onClick={getAffLink}>复制邀请链接</Button>
|
||||||
<Button onClick={() => {
|
<Button onClick={() => {
|
||||||
setShowAccountDeleteModal(true);
|
setShowAccountDeleteModal(true);
|
||||||
}} color='red'>删除个人账户</Button>
|
}}>删除个人账户</Button>
|
||||||
<Divider />
|
<Divider />
|
||||||
<Header as='h3'>账号绑定</Header>
|
<Header as='h3'>账号绑定</Header>
|
||||||
{
|
{
|
||||||
@ -266,14 +266,13 @@ const PersonalSetting = () => {
|
|||||||
size={'tiny'}
|
size={'tiny'}
|
||||||
style={{ maxWidth: '450px' }}
|
style={{ maxWidth: '450px' }}
|
||||||
>
|
>
|
||||||
<Modal.Header>您是否确认删除自己的帐户?</Modal.Header>
|
<Modal.Header>确认删除自己的帐户</Modal.Header>
|
||||||
<Modal.Content>
|
<Modal.Content>
|
||||||
<Modal.Description>
|
<Modal.Description>
|
||||||
<Form size='large'>
|
<Form size='large'>
|
||||||
<Form.Input
|
<Form.Input
|
||||||
fluid
|
fluid
|
||||||
label='请输入 "CONFIRM" 以删除您的帐户。'
|
placeholder={`输入你的账户名 ${userState.user.username} 以确认删除`}
|
||||||
placeholder='确认文字'
|
|
||||||
name='self_account_deletion_confirmation'
|
name='self_account_deletion_confirmation'
|
||||||
value={inputs.self_account_deletion_confirmation}
|
value={inputs.self_account_deletion_confirmation}
|
||||||
onChange={handleInputChange}
|
onChange={handleInputChange}
|
||||||
|
Loading…
Reference in New Issue
Block a user