mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-20 17:26:38 +08:00
fix: 删除用户改为注销
This commit is contained in:
parent
c1040afed9
commit
692455ef2a
@ -208,11 +208,9 @@ const UsersTable = () => {
|
|||||||
>
|
>
|
||||||
编辑
|
编辑
|
||||||
</Button>
|
</Button>
|
||||||
</>
|
|
||||||
)}
|
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
title='确定是否要删除此用户?'
|
title='确定是否要注销此用户?'
|
||||||
content='硬删除,此修改将不可逆'
|
content='相当于删除用户,此修改将不可逆'
|
||||||
okType={'danger'}
|
okType={'danger'}
|
||||||
position={'left'}
|
position={'left'}
|
||||||
onConfirm={() => {
|
onConfirm={() => {
|
||||||
@ -222,9 +220,11 @@ const UsersTable = () => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Button theme='light' type='danger' style={{ marginRight: 1 }}>
|
<Button theme='light' type='danger' style={{ marginRight: 1 }}>
|
||||||
删除
|
注销
|
||||||
</Button>
|
</Button>
|
||||||
</Popconfirm>
|
</Popconfirm>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
@ -253,13 +253,13 @@ const UsersTable = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const removeRecord = (key) => {
|
const removeRecord = (key) => {
|
||||||
console.log(key);
|
|
||||||
let newDataSource = [...users];
|
let newDataSource = [...users];
|
||||||
if (key != null) {
|
if (key != null) {
|
||||||
let idx = newDataSource.findIndex((data) => data.id === key);
|
let idx = newDataSource.findIndex((data) => data.id === key);
|
||||||
|
|
||||||
if (idx > -1) {
|
if (idx > -1) {
|
||||||
newDataSource.splice(idx, 1);
|
// update deletedAt
|
||||||
|
newDataSource[idx].DeletedAt = new Date();
|
||||||
setUsers(newDataSource);
|
setUsers(newDataSource);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user