Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
site-project
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hqzhdj
site-project
Commits
37358d6b
Commit
37358d6b
authored
Nov 13, 2025
by
wangxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权限接口
parent
3579affe
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
13 deletions
+15
-13
cloud-site-service/src/main/java/com/yizhi/site/application/controller/api/SystemMailboxController.java
+2
-7
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/SystemMailboxServiceImpl.java
+13
-6
No files found.
cloud-site-service/src/main/java/com/yizhi/site/application/controller/api/SystemMailboxController.java
View file @
37358d6b
...
...
@@ -49,12 +49,6 @@ public class SystemMailboxController {
@GetMapping
(
"hasPermission"
)
public
Boolean
hasPermission
(){
Page
<
SystemMailboxParamVo
>
page
=
systemMailboxService
.
selectMyPage
(
1
,
1
,
2
);
// 如果能正常获取到数据且total大于0,说明用户有权限
if
(
page
!=
null
&&
page
.
getTotal
()
>
0
)
{
return
true
;
}
// 如果total为0,说明用户没有权限查看信箱
return
false
;
return
systemMailboxService
.
hasPermission
();
}
}
\ No newline at end of file
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/SystemMailboxServiceImpl.java
View file @
37358d6b
...
...
@@ -169,12 +169,18 @@ public class SystemMailboxServiceImpl extends ServiceImpl<SystemMailboxMapper,Sy
@Override
public
Boolean
hasPermission
()
{
Page
<
SystemMailboxParamVo
>
page
=
selectMyPage
(
1
,
1
,
2
);
// 如果能正常获取到数据且total大于0,说明用户有权限
if
(
page
!=
null
&&
page
.
getTotal
()
>
0
)
{
return
true
;
Long
accountId
=
ContextHolder
.
get
().
getAccountId
();
List
<
Long
>
roleIds
=
myItemConfigmapper
.
getJjXxRoleCount
(
accountId
);
Integer
roleType
=
null
;
//信箱类型 1: 纪检 2: 书记,null没权限看 纪检和书记,只能看自己的
if
(
CollectionUtil
.
isNotEmpty
(
roleIds
)){
if
(
roleIds
.
contains
(
1877604582759526400L
)&&!
roleIds
.
contains
(
1877605828904022016L
)){
roleType
=
2
;
}
if
(!
roleIds
.
contains
(
1877604582759526400L
)&&
roleIds
.
contains
(
1877605828904022016L
)){
roleType
=
1
;
}
}
//
如果total为0,说明用户没有权限查看信箱
return
false
;
//
return
roleType
!=
null
;
}
}
\ No newline at end of file
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