Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
elearn
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
elearn
Commits
f8e8c652
Commit
f8e8c652
authored
Sep 01, 2025
by
Lichen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录接口添加角色信息查询
parent
ec78bfb7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
0 deletions
+26
-0
cloud-system/src/main/java/com/yizhi/system/application/controller/api/AuthController.java
+13
-0
cloud-system/src/main/java/com/yizhi/system/application/service/AuthService.java
+8
-0
cloud-system/src/main/java/com/yizhi/system/application/service/impl/AuthServiceImpl.java
+5
-0
No files found.
cloud-system/src/main/java/com/yizhi/system/application/controller/api/AuthController.java
View file @
f8e8c652
...
@@ -31,6 +31,7 @@ import com.yizhi.site.application.vo.site.MyItemConfigVO;
...
@@ -31,6 +31,7 @@ import com.yizhi.site.application.vo.site.MyItemConfigVO;
import
com.yizhi.system.application.constant.SecurityError
;
import
com.yizhi.system.application.constant.SecurityError
;
import
com.yizhi.system.application.controller.manage.AccountController
;
import
com.yizhi.system.application.controller.manage.AccountController
;
import
com.yizhi.system.application.domain.Account
;
import
com.yizhi.system.application.domain.Account
;
import
com.yizhi.system.application.domain.AuthzRole
;
import
com.yizhi.system.application.domain.Site
;
import
com.yizhi.system.application.domain.Site
;
import
com.yizhi.system.application.enums.SecurityReturnCode
;
import
com.yizhi.system.application.enums.SecurityReturnCode
;
import
com.yizhi.system.application.exception.AuthNoManagementException
;
import
com.yizhi.system.application.exception.AuthNoManagementException
;
...
@@ -259,6 +260,16 @@ public class AuthController {
...
@@ -259,6 +260,16 @@ public class AuthController {
}
}
/**
* 添加角色信息
* @param retMap
* @param user
*/
private
void
setAuthInfo
(
Map
<
String
,
Object
>
retMap
,
Account
user
)
{
List
<
AuthzRole
>
roles
=
authService
.
getByAccountId
(
user
.
getId
());
retMap
.
put
(
"authList"
,
roles
);
}
@ApiOperation
(
value
=
"用户登录"
,
notes
=
"用户登录"
,
extensions
=
{
@ApiOperation
(
value
=
"用户登录"
,
notes
=
"用户登录"
,
extensions
=
{
@Extension
(
name
=
ReturnCode
.
API_SUB_FLAG
,
properties
=
{
@Extension
(
name
=
ReturnCode
.
API_SUB_FLAG
,
properties
=
{
@ExtensionProperty
(
name
=
SecurityError
.
LOGIN_INFO_ERROR
,
value
=
SecurityError
.
LOGIN_INFO_ERROR_MSG
)})})
@ExtensionProperty
(
name
=
SecurityError
.
LOGIN_INFO_ERROR
,
value
=
SecurityError
.
LOGIN_INFO_ERROR_MSG
)})})
...
@@ -317,6 +328,8 @@ public class AuthController {
...
@@ -317,6 +328,8 @@ public class AuthController {
setRetMap
(
retMap
,
user
,
token
,
context
);
setRetMap
(
retMap
,
user
,
token
,
context
);
//设置签到弹框
//设置签到弹框
setEnableSign
(
retMap
,
user
,
context
);
setEnableSign
(
retMap
,
user
,
context
);
// 添加角色
setAuthInfo
(
retMap
,
user
);
httpResponse
.
addHeader
(
GlobalConstant
.
TOKEN_HEADER
,
token
);
httpResponse
.
addHeader
(
GlobalConstant
.
TOKEN_HEADER
,
token
);
//设置最后一次登录站点信息
//设置最后一次登录站点信息
setStudentLastLoginRecordCache
(
user
.
getId
(),
context
);
setStudentLastLoginRecordCache
(
user
.
getId
(),
context
);
...
...
cloud-system/src/main/java/com/yizhi/system/application/service/AuthService.java
View file @
f8e8c652
...
@@ -2,6 +2,7 @@ package com.yizhi.system.application.service;
...
@@ -2,6 +2,7 @@ package com.yizhi.system.application.service;
import
com.yizhi.system.application.constant.AuthzConstant
;
import
com.yizhi.system.application.constant.AuthzConstant
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.system.application.domain.AuthzRole
;
import
com.yizhi.system.application.exception.AuthNoManagementException
;
import
com.yizhi.system.application.exception.AuthNoManagementException
;
import
com.yizhi.system.application.exception.AuthNotManageException
;
import
com.yizhi.system.application.exception.AuthNotManageException
;
import
com.yizhi.system.application.model.AccessSite
;
import
com.yizhi.system.application.model.AccessSite
;
...
@@ -111,4 +112,11 @@ public interface AuthService {
...
@@ -111,4 +112,11 @@ public interface AuthService {
*/
*/
public
Integer
getOverlapUserCount
(
OrgAccountVo
adminManageUserInfo
,
List
<
Long
>
serviceVisibleOrgIds
,
List
<
Long
>
serviceVisibleUserIds
,
Long
siteId
,
Long
companyId
);
public
Integer
getOverlapUserCount
(
OrgAccountVo
adminManageUserInfo
,
List
<
Long
>
serviceVisibleOrgIds
,
List
<
Long
>
serviceVisibleUserIds
,
Long
siteId
,
Long
companyId
);
/**
* 根据用户ID查询关联角色
* @param accountId
* @return
*/
public
List
<
AuthzRole
>
getByAccountId
(
Long
accountId
);
}
}
cloud-system/src/main/java/com/yizhi/system/application/service/impl/AuthServiceImpl.java
View file @
f8e8c652
...
@@ -743,4 +743,9 @@ public class AuthServiceImpl implements AuthService {
...
@@ -743,4 +743,9 @@ public class AuthServiceImpl implements AuthService {
}
}
return
allordIds
;
return
allordIds
;
}
}
@Override
public
List
<
AuthzRole
>
getByAccountId
(
Long
accountId
)
{
return
roleMapper
.
getByAccountId
(
accountId
);
}
}
}
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