Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-usercenter
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8263db3d
authored
Jul 18, 2023
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1.22.0 实现特殊登陆标记功能
1 parent
f39ff14d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
src/main/java/cn/com/glsx/shield/modules/service/UserService.java
src/main/java/cn/com/glsx/shield/modules/service/UserService.java
View file @
8263db3
...
...
@@ -21,6 +21,7 @@ import cn.com.glsx.shield.modules.util.ChineseCharacterUtil;
import
cn.com.glsx.usercenter.api.dto.request.FindUserRequest
;
import
cn.com.glsx.usercenter.api.dto.request.SimpleAddUser
;
import
cn.com.glsx.usercenter.api.enums.SpecialLoginEnum
;
import
cn.com.glsx.usercenter.api.enums.SpecialMarkEnum
;
import
cn.hutool.core.lang.UUID
;
import
cn.hutool.json.JSONUtil
;
import
com.github.pagehelper.Page
;
...
...
@@ -638,8 +639,18 @@ public class UserService {
public
void
verifySpecialMark
(
User
user
,
String
specialMark
)
{
Integer
specialLogin
=
user
.
getSpecialLogin
();
if
(
SpecialLoginEnum
.
SPECIAL_LOGIN
.
getCode
().
equals
(
specialLogin
))
{
if
(
SpecialMarkEnum
.
MINI_SPECIAL_LOGIN_FLAG
.
getName
().
equals
(
specialMark
))
{
// 小程序默认登录加密串 小程序都不能允许登录
throw
new
UserCenterException
(
"此账户限制登录,请与管理员联系"
);
}
// web如果数据库没有加密字符串 则是第一次登录 或者重置以后 校验通过
if
(
Objects
.
isNull
(
user
.
getSpecialMark
()))
{
return
;
}
// 如果是特殊登陆校验加密字符串
if
(
StringUtils
.
isNullOrEmpty
(
specialMark
)
||
!
Objects
.
equals
(
user
.
getSpecialMark
(),
specialMark
))
{
if
(!
Objects
.
equals
(
user
.
getSpecialMark
(),
specialMark
))
{
throw
new
UserCenterException
(
"此账户限制登录,请与管理员联系"
);
}
}
...
...
@@ -1120,7 +1131,7 @@ public class UserService {
return
;
}
if
(
Objects
.
isNull
(
user
.
getSpecial
Login
())
&&
Objects
.
nonNull
(
loginBO
.
getSpecialMark
()))
{
if
(
Objects
.
isNull
(
user
.
getSpecial
Mark
())
&&
Objects
.
nonNull
(
loginBO
.
getSpecialMark
()))
{
Integer
num
=
userMapper
.
saveUIDById
(
user
.
getId
(),
loginBO
.
getSpecialMark
());
log
.
info
(
user
.
getId
()
+
":saveUID:"
+
num
);
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment