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
595289ee
Commit
595289ee
authored
Mar 31, 2025
by
阳浪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录优化
parent
48a40242
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
0 deletions
+25
-0
cloud-system/src/main/java/com/yizhi/system/application/controller/api/AuthController.java
+10
-0
cloud-system/src/main/java/com/yizhi/system/application/mapper/AccountMapper.java
+0
-0
cloud-system/src/main/java/com/yizhi/system/application/service/IAccountService.java
+0
-0
cloud-system/src/main/java/com/yizhi/system/application/service/impl/AccountServiceImpl.java
+4
-0
cloud-system/src/main/resources/mybatis/AccountMapper.xml
+11
-0
No files found.
cloud-system/src/main/java/com/yizhi/system/application/controller/api/AuthController.java
View file @
595289ee
...
...
@@ -31,6 +31,7 @@ import com.yizhi.site.application.vo.site.MyItemConfigVO;
import
com.yizhi.system.application.constant.SecurityError
;
import
com.yizhi.system.application.controller.manage.AccountController
;
import
com.yizhi.system.application.domain.Account
;
import
com.yizhi.system.application.domain.Site
;
import
com.yizhi.system.application.enums.SecurityReturnCode
;
import
com.yizhi.system.application.exception.AuthNoManagementException
;
import
com.yizhi.system.application.exception.AuthNotManageException
;
...
...
@@ -223,6 +224,7 @@ public class AuthController {
user
.
setPassword
(
""
);
retMap
.
put
(
"userInfo"
,
user
);
retMap
.
put
(
"siteId"
,
context
.
getSiteId
().
toString
());
retMap
.
put
(
"siteCode"
,
context
.
getSiteCode
());
}
/**
...
...
@@ -293,6 +295,14 @@ public class AuthController {
}
context
.
setAccountId
(
user
.
getId
());
context
.
setOrgId
(
user
.
getOrgId
());
Long
siteId
=
accountService
.
findSiteId
(
user
.
getId
());
if
(
siteId
!=
null
)
{
context
.
setSiteId
(
siteId
);
Site
site
=
siteService
.
findById
(
siteId
);
if
(
site
!=
null
){
context
.
setSiteCode
(
site
.
getCode
());
}
}
String
token
=
createToken
(
user
,
context
);
// 生成token(不是首次登陆)
if
(!
firstLoginFlg
)
{
...
...
cloud-system/src/main/java/com/yizhi/system/application/mapper/AccountMapper.java
View file @
595289ee
This diff is collapsed.
Click to expand it.
cloud-system/src/main/java/com/yizhi/system/application/service/IAccountService.java
View file @
595289ee
This diff is collapsed.
Click to expand it.
cloud-system/src/main/java/com/yizhi/system/application/service/impl/AccountServiceImpl.java
View file @
595289ee
...
...
@@ -2636,4 +2636,8 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
return
wrapper
;
}
@Override
public
Long
findSiteId
(
Long
accountId
){
return
this
.
accountMapper
.
findSiteId
(
accountId
);
}
}
cloud-system/src/main/resources/mybatis/AccountMapper.xml
View file @
595289ee
...
...
@@ -997,5 +997,16 @@
where 1=1 and id in(
<foreach
collection=
"idList"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
) and
deleted=0
</select>
<select
id=
"findSiteId"
resultType=
"java.lang.Long"
>
select
distinct ar.site_id
from
authz_account_role aar
left join authz_role ar on
aar.role_id = ar.id
where
account_id = #{accountId}
limit 1
</select>
</mapper>
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