Commit e54906ef by JustSong

feat: disable operations for root user (close #76)

parent 146ab7d2
...@@ -234,6 +234,7 @@ const UsersTable = () => { ...@@ -234,6 +234,7 @@ const UsersTable = () => {
onClick={() => { onClick={() => {
manageUser(user.username, 'promote', idx); manageUser(user.username, 'promote', idx);
}} }}
disabled={user.role === 100}
> >
提升 提升
</Button> </Button>
...@@ -243,12 +244,13 @@ const UsersTable = () => { ...@@ -243,12 +244,13 @@ const UsersTable = () => {
onClick={() => { onClick={() => {
manageUser(user.username, 'demote', idx); manageUser(user.username, 'demote', idx);
}} }}
disabled={user.role === 100}
> >
降级 降级
</Button> </Button>
<Popup <Popup
trigger={ trigger={
<Button size='small' negative> <Button size='small' negative disabled={user.role === 100}>
删除 删除
</Button> </Button>
} }
...@@ -274,6 +276,7 @@ const UsersTable = () => { ...@@ -274,6 +276,7 @@ const UsersTable = () => {
idx idx
); );
}} }}
disabled={user.role === 100}
> >
{user.status === 1 ? '禁用' : '启用'} {user.status === 1 ? '禁用' : '启用'}
</Button> </Button>
...@@ -281,6 +284,7 @@ const UsersTable = () => { ...@@ -281,6 +284,7 @@ const UsersTable = () => {
size={'small'} size={'small'}
as={Link} as={Link}
to={'/user/edit/' + user.id} to={'/user/edit/' + user.id}
disabled={user.role === 100}
> >
编辑 编辑
</Button> </Button>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment