Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangpeng
dinky
Commits
0c471713
Unverified
Commit
0c471713
authored
Dec 19, 2023
by
Zzm0809
Committed by
GitHub
Dec 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix user admin delete bug (#2685)
* Spotless Apply * fix user admin delete bug --------- Co-authored-by:
Zzm0809
<
Zzm0809@users.noreply.github.com
>
parent
88f4c6ca
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
1 deletion
+9
-1
UserServiceImpl.java
...src/main/java/org/dinky/service/impl/UserServiceImpl.java
+5
-0
Status.java
dinky-common/src/main/java/org/dinky/data/enums/Status.java
+1
-0
messages_en_US.properties
...-common/src/main/resources/i18n/messages_en_US.properties
+1
-0
messages_zh_CN.properties
...-common/src/main/resources/i18n/messages_zh_CN.properties
+1
-0
index.tsx
...c/pages/AuthCenter/User/components/UserProTable/index.tsx
+1
-1
No files found.
dinky-admin/src/main/java/org/dinky/service/impl/UserServiceImpl.java
View file @
0c471713
...
@@ -31,6 +31,7 @@ import org.dinky.data.dto.UserDTO;
...
@@ -31,6 +31,7 @@ import org.dinky.data.dto.UserDTO;
import
org.dinky.data.enums.Status
;
import
org.dinky.data.enums.Status
;
import
org.dinky.data.enums.UserType
;
import
org.dinky.data.enums.UserType
;
import
org.dinky.data.exception.AuthException
;
import
org.dinky.data.exception.AuthException
;
import
org.dinky.data.exception.BusException
;
import
org.dinky.data.model.SysToken
;
import
org.dinky.data.model.SysToken
;
import
org.dinky.data.model.SystemConfiguration
;
import
org.dinky.data.model.SystemConfiguration
;
import
org.dinky.data.model.rbac.Menu
;
import
org.dinky.data.model.rbac.Menu
;
...
@@ -152,6 +153,10 @@ public class UserServiceImpl extends SuperServiceImpl<UserMapper, User> implemen
...
@@ -152,6 +153,10 @@ public class UserServiceImpl extends SuperServiceImpl<UserMapper, User> implemen
@Override
@Override
public
Boolean
removeUser
(
Integer
id
)
{
public
Boolean
removeUser
(
Integer
id
)
{
User
user
=
getById
(
id
);
if
(
user
.
getSuperAdminFlag
())
{
throw
new
BusException
(
Status
.
USER_SUPERADMIN_CANNOT_DELETE
);
}
return
baseMapper
.
deleteById
(
id
)
>
0
;
return
baseMapper
.
deleteById
(
id
)
>
0
;
}
}
...
...
dinky-common/src/main/java/org/dinky/data/enums/Status.java
View file @
0c471713
...
@@ -124,6 +124,7 @@ public enum Status {
...
@@ -124,6 +124,7 @@ public enum Status {
KICK_OUT
(
10024
,
"kick.out"
),
KICK_OUT
(
10024
,
"kick.out"
),
TOKEN_FREEZED
(
10025
,
"token.freezed"
),
TOKEN_FREEZED
(
10025
,
"token.freezed"
),
NO_PREFIX
(
10026
,
"no.prefix"
),
NO_PREFIX
(
10026
,
"no.prefix"
),
USER_SUPERADMIN_CANNOT_DELETE
(
10027
,
"user.superadmin.cannot.delete"
),
// role
// role
ROLE_ALREADY_EXISTS
(
10101
,
"role.already.exists"
),
ROLE_ALREADY_EXISTS
(
10101
,
"role.already.exists"
),
...
...
dinky-common/src/main/resources/i18n/messages_en_US.properties
View file @
0c471713
...
@@ -7,6 +7,7 @@ ldap.user.duplicat=The ldap matches to multiple user data
...
@@ -7,6 +7,7 @@ ldap.user.duplicat=The ldap matches to multiple user data
git.branch.not.found
=
Git Branch Not Found
git.branch.not.found
=
Git Branch Not Found
copy.success
=
Copy Successfully
copy.success
=
Copy Successfully
user.superadmin.cannot.disable
=
User SuperAdmin Cannot Disable
user.superadmin.cannot.disable
=
User SuperAdmin Cannot Disable
user.superadmin.cannot.delete
=
User SuperAdmin Cannot Delete
ds.work.flow.not.save
=
Please Save Workflow First
ds.work.flow.not.save
=
Please Save Workflow First
schedule.status.unknown
=
Unknown Status: {0}
schedule.status.unknown
=
Unknown Status: {0}
user.binding.role.delete.all
=
User Binding Role Delete All
user.binding.role.delete.all
=
User Binding Role Delete All
...
...
dinky-common/src/main/resources/i18n/messages_zh_CN.properties
View file @
0c471713
...
@@ -7,6 +7,7 @@ ldap.user.duplicat=ldap匹配到多个用户数据
...
@@ -7,6 +7,7 @@ ldap.user.duplicat=ldap匹配到多个用户数据
git.branch.not.found
=
获取不到分支信息
git.branch.not.found
=
获取不到分支信息
copy.success
=
复制成功
copy.success
=
复制成功
user.superadmin.cannot.disable
=
超级管理员用户不能停用
user.superadmin.cannot.disable
=
超级管理员用户不能停用
user.superadmin.cannot.delete
=
超级管理员用户不能删除
ds.work.flow.not.save
=
请先保存工作流
ds.work.flow.not.save
=
请先保存工作流
schedule.status.unknown
=
未知状态: {0}
schedule.status.unknown
=
未知状态: {0}
user.binding.role.delete.all
=
用户绑定角色删除所有
user.binding.role.delete.all
=
用户绑定角色删除所有
...
...
dinky-web/src/pages/AuthCenter/User/components/UserProTable/index.tsx
View file @
0c471713
...
@@ -276,7 +276,7 @@ const UserProTable = () => {
...
@@ -276,7 +276,7 @@ const UserProTable = () => {
</
Authorized
>,
</
Authorized
>,
<
Authorized
key=
{
`${record.id}_delete_auth`
}
path=
'/auth/user/delete'
>
<
Authorized
key=
{
`${record.id}_delete_auth`
}
path=
'/auth/user/delete'
>
<>
<>
{
access
.
isAdmin
&&
!
record
.
isDelete
&&
(
{
access
.
isAdmin
&&
!
record
.
isDelete
&&
!
record
.
superAdminFlag
&&
(
<
PopconfirmDeleteBtn
<
PopconfirmDeleteBtn
key=
{
`${record.id}_delete`
}
key=
{
`${record.id}_delete`
}
onClick=
{
()
=>
handleDeleteUser
(
record
)
}
onClick=
{
()
=>
handleDeleteUser
(
record
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment