Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Eladmin
Commits
0248c7d0
Commit
0248c7d0
authored
Mar 01, 2019
by
zhengjie
Browse files
取消默认的后端限制
parent
7fbefa9a
Changes
4
Hide whitespace changes
Inline
Side-by-side
eladmin-system/src/main/java/me/zhengjie/modules/system/domain/vo/MenuMetaVo.java
View file @
0248c7d0
...
...
@@ -2,7 +2,6 @@ package me.zhengjie.modules.system.domain.vo;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/PermissionServiceImpl.java
View file @
0248c7d0
...
...
@@ -48,13 +48,6 @@ public class PermissionServiceImpl implements PermissionService {
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
update
(
Permission
resources
)
{
/**
* 根据实际需求修改
*/
if
(
resources
.
getId
().
equals
(
1L
)){
throw
new
BadRequestException
(
"该权限不能被修改"
);
}
Optional
<
Permission
>
optionalPermission
=
permissionRepository
.
findById
(
resources
.
getId
());
ValidationUtil
.
isNull
(
optionalPermission
,
"Permission"
,
"id"
,
resources
.
getId
());
...
...
@@ -75,13 +68,6 @@ public class PermissionServiceImpl implements PermissionService {
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
delete
(
Long
id
)
{
/**
* 根据实际需求修改
*/
if
(
id
.
equals
(
1L
)){
throw
new
BadRequestException
(
"该权限不能被删除"
);
}
List
<
Permission
>
permissionList
=
permissionRepository
.
findByPid
(
id
);
for
(
Permission
permission
:
permissionList
)
{
permissionRepository
.
delete
(
permission
);
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/RoleServiceImpl.java
View file @
0248c7d0
...
...
@@ -48,14 +48,6 @@ public class RoleServiceImpl implements RoleService {
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
update
(
Role
resources
)
{
/**
* 根据实际需求修改
*/
if
(
resources
.
getId
().
equals
(
1L
)){
throw
new
BadRequestException
(
"该角色不能被修改"
);
}
Optional
<
Role
>
optionalRole
=
roleRepository
.
findById
(
resources
.
getId
());
ValidationUtil
.
isNull
(
optionalRole
,
"Role"
,
"id"
,
resources
.
getId
());
...
...
@@ -74,12 +66,6 @@ public class RoleServiceImpl implements RoleService {
@Override
public
void
updatePermission
(
Role
resources
,
RoleDTO
roleDTO
)
{
/**
* 根据实际需求修改
*/
if
(
resources
.
getId
().
equals
(
1L
)){
throw
new
BadRequestException
(
"该角色不可操作"
);
}
Role
role
=
roleMapper
.
toEntity
(
roleDTO
);
role
.
setPermissions
(
resources
.
getPermissions
());
roleRepository
.
save
(
role
);
...
...
@@ -87,12 +73,6 @@ public class RoleServiceImpl implements RoleService {
@Override
public
void
updateMenu
(
Role
resources
,
RoleDTO
roleDTO
)
{
/**
* 根据实际需求修改
*/
if
(
resources
.
getId
().
equals
(
1L
)){
throw
new
BadRequestException
(
"该角色不可操作"
);
}
Role
role
=
roleMapper
.
toEntity
(
roleDTO
);
role
.
setMenus
(
resources
.
getMenus
());
roleRepository
.
save
(
role
);
...
...
@@ -101,12 +81,6 @@ public class RoleServiceImpl implements RoleService {
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
delete
(
Long
id
)
{
/**
* 根据实际需求修改
*/
if
(
id
.
equals
(
1L
)){
throw
new
BadRequestException
(
"该角色不能被删除"
);
}
roleRepository
.
deleteById
(
id
);
}
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java
View file @
0248c7d0
...
...
@@ -68,13 +68,6 @@ public class UserServiceImpl implements UserService {
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
update
(
User
resources
)
{
/**
* 根据实际需求修改
*/
if
(
resources
.
getId
().
equals
(
1L
)){
throw
new
BadRequestException
(
"该账号不能被修改"
);
}
Optional
<
User
>
userOptional
=
userRepository
.
findById
(
resources
.
getId
());
ValidationUtil
.
isNull
(
userOptional
,
"User"
,
"id"
,
resources
.
getId
());
...
...
@@ -106,12 +99,6 @@ public class UserServiceImpl implements UserService {
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
delete
(
Long
id
)
{
/**
* 根据实际需求修改
*/
if
(
id
.
equals
(
1L
)){
throw
new
BadRequestException
(
"该账号不能被删除"
);
}
userRepository
.
deleteById
(
id
);
}
...
...
Write
Preview
Supports
Markdown
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