Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzuaa
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzuaa
提交
b67ad6d5
提交
b67ad6d5
编写于
10月 27, 2021
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
支持sm3
上级
42b4860d
变更
4
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
17 行增加
和
0 行删除
+17
-0
LdapUserService.java
.../ibizlab/core/uaa/extensions/service/LdapUserService.java
+3
-0
UAAUserService.java
...n/ibizlab/core/uaa/extensions/service/UAAUserService.java
+3
-0
UserRegisterService.java
...zlab/core/uaa/extensions/service/UserRegisterService.java
+6
-0
ClientAuthenticationResource.java
...lab/api/rest/extensions/ClientAuthenticationResource.java
+5
-0
未找到文件。
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/extensions/service/LdapUserService.java
浏览文件 @
b67ad6d5
...
@@ -7,6 +7,7 @@ import cn.ibizlab.core.uaa.service.impl.SysUserServiceImpl;
...
@@ -7,6 +7,7 @@ import cn.ibizlab.core.uaa.service.impl.SysUserServiceImpl;
import
cn.ibizlab.util.client.IBZOUFeignClient
;
import
cn.ibizlab.util.client.IBZOUFeignClient
;
import
cn.ibizlab.util.errors.BadRequestAlertException
;
import
cn.ibizlab.util.errors.BadRequestAlertException
;
import
cn.ibizlab.util.helper.CachedBeanCopier
;
import
cn.ibizlab.util.helper.CachedBeanCopier
;
import
cn.ibizlab.util.helper.Sm3Util
;
import
cn.ibizlab.util.security.AuthenticationUser
;
import
cn.ibizlab.util.security.AuthenticationUser
;
import
cn.ibizlab.util.service.AuthenticationUserService
;
import
cn.ibizlab.util.service.AuthenticationUserService
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
...
@@ -91,6 +92,8 @@ public class LdapUserService implements AuthenticationUserService {
...
@@ -91,6 +92,8 @@ public class LdapUserService implements AuthenticationUserService {
password
=
DigestUtils
.
md5DigestAsHex
(
password
.
getBytes
());
password
=
DigestUtils
.
md5DigestAsHex
(
password
.
getBytes
());
else
if
(
pwencrymode
==
2
)
else
if
(
pwencrymode
==
2
)
password
=
DigestUtils
.
md5DigestAsHex
(
String
.
format
(
"%1$s||%2$s"
,
username
,
password
).
getBytes
());
password
=
DigestUtils
.
md5DigestAsHex
(
String
.
format
(
"%1$s||%2$s"
,
username
,
password
).
getBytes
());
else
if
(
pwencrymode
==
3
&&
password
.
length
()!=
64
)
password
=
Sm3Util
.
encrypt
(
password
).
toUpperCase
();
if
(!
user
.
getPassword
().
equals
(
password
))
{
if
(!
user
.
getPassword
().
equals
(
password
))
{
throw
new
BadRequestAlertException
(
"用户名密码错误"
,
"IBZUSER"
,
username
);
throw
new
BadRequestAlertException
(
"用户名密码错误"
,
"IBZUSER"
,
username
);
}
}
...
...
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/extensions/service/UAAUserService.java
浏览文件 @
b67ad6d5
...
@@ -5,6 +5,7 @@ import cn.ibizlab.core.uaa.mapper.SysUserMapper;
...
@@ -5,6 +5,7 @@ import cn.ibizlab.core.uaa.mapper.SysUserMapper;
import
cn.ibizlab.core.uaa.service.ISysUserService
;
import
cn.ibizlab.core.uaa.service.ISysUserService
;
import
cn.ibizlab.core.uaa.service.impl.SysUserServiceImpl
;
import
cn.ibizlab.core.uaa.service.impl.SysUserServiceImpl
;
import
cn.ibizlab.util.client.IBZOUFeignClient
;
import
cn.ibizlab.util.client.IBZOUFeignClient
;
import
cn.ibizlab.util.helper.Sm3Util
;
import
cn.ibizlab.util.service.AuthenticationUserService
;
import
cn.ibizlab.util.service.AuthenticationUserService
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
@@ -80,6 +81,8 @@ public class UAAUserService implements AuthenticationUserService {
...
@@ -80,6 +81,8 @@ public class UAAUserService implements AuthenticationUserService {
password
=
DigestUtils
.
md5DigestAsHex
(
password
.
getBytes
());
password
=
DigestUtils
.
md5DigestAsHex
(
password
.
getBytes
());
else
if
(
pwencrymode
==
2
)
else
if
(
pwencrymode
==
2
)
password
=
DigestUtils
.
md5DigestAsHex
(
String
.
format
(
"%1$s||%2$s"
,
username
,
password
).
getBytes
());
password
=
DigestUtils
.
md5DigestAsHex
(
String
.
format
(
"%1$s||%2$s"
,
username
,
password
).
getBytes
());
else
if
(
pwencrymode
==
3
&&
password
.
length
()!=
64
)
password
=
Sm3Util
.
encrypt
(
password
).
toUpperCase
();
if
(!
authuserdetail
.
getPassword
().
equals
(
password
)){
if
(!
authuserdetail
.
getPassword
().
equals
(
password
)){
throw
new
BadRequestAlertException
(
"用户名密码错误"
,
"IBZUSER"
,
username
);
throw
new
BadRequestAlertException
(
"用户名密码错误"
,
"IBZUSER"
,
username
);
}
}
...
...
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/extensions/service/UserRegisterService.java
浏览文件 @
b67ad6d5
...
@@ -5,6 +5,7 @@ import cn.ibizlab.core.uaa.domain.SysUserAuth;
...
@@ -5,6 +5,7 @@ import cn.ibizlab.core.uaa.domain.SysUserAuth;
import
cn.ibizlab.core.uaa.service.ISysUserAuthService
;
import
cn.ibizlab.core.uaa.service.ISysUserAuthService
;
import
cn.ibizlab.core.uaa.service.ISysUserService
;
import
cn.ibizlab.core.uaa.service.ISysUserService
;
import
cn.ibizlab.util.errors.BadRequestAlertException
;
import
cn.ibizlab.util.errors.BadRequestAlertException
;
import
cn.ibizlab.util.helper.Sm3Util
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -75,6 +76,8 @@ public class UserRegisterService {
...
@@ -75,6 +76,8 @@ public class UserRegisterService {
password
=
DigestUtils
.
md5DigestAsHex
(
password
.
getBytes
());
password
=
DigestUtils
.
md5DigestAsHex
(
password
.
getBytes
());
else
if
(
pwencrymode
==
2
)
else
if
(
pwencrymode
==
2
)
password
=
DigestUtils
.
md5DigestAsHex
(
String
.
format
(
"%1$s||%2$s"
,
username
,
password
).
getBytes
());
password
=
DigestUtils
.
md5DigestAsHex
(
String
.
format
(
"%1$s||%2$s"
,
username
,
password
).
getBytes
());
else
if
(
pwencrymode
==
3
&&
password
.
length
()!=
64
)
password
=
Sm3Util
.
encrypt
(
password
).
toUpperCase
();
if
(!
password
.
equals
(
existedUser
.
getPassword
()))
if
(!
password
.
equals
(
existedUser
.
getPassword
()))
throw
new
BadRequestAlertException
(
"绑定到已有账号失败,请输入正确的密码"
,
"UserRegisterResource"
,
""
);
throw
new
BadRequestAlertException
(
"绑定到已有账号失败,请输入正确的密码"
,
"UserRegisterResource"
,
""
);
...
@@ -90,6 +93,9 @@ public class UserRegisterService {
...
@@ -90,6 +93,9 @@ public class UserRegisterService {
password
=
DigestUtils
.
md5DigestAsHex
(
password
.
getBytes
());
password
=
DigestUtils
.
md5DigestAsHex
(
password
.
getBytes
());
else
if
(
pwencrymode
==
2
)
else
if
(
pwencrymode
==
2
)
password
=
DigestUtils
.
md5DigestAsHex
(
String
.
format
(
"%1$s||%2$s"
,
username
,
password
).
getBytes
());
password
=
DigestUtils
.
md5DigestAsHex
(
String
.
format
(
"%1$s||%2$s"
,
username
,
password
).
getBytes
());
else
if
(
pwencrymode
==
3
&&
password
.
length
()!=
64
)
password
=
Sm3Util
.
encrypt
(
password
).
toUpperCase
();
account
.
setPassword
(
password
);
account
.
setPassword
(
password
);
account
.
setUserid
(
username
);
account
.
setUserid
(
username
);
sysUserService
.
save
(
account
);
sysUserService
.
save
(
account
);
...
...
ibzuaa-provider/ibzuaa-provider-api/src/main/java/cn/ibizlab/api/rest/extensions/ClientAuthenticationResource.java
浏览文件 @
b67ad6d5
...
@@ -7,6 +7,7 @@ import cn.ibizlab.core.uaa.service.ISysUserService;
...
@@ -7,6 +7,7 @@ import cn.ibizlab.core.uaa.service.ISysUserService;
import
cn.ibizlab.util.domain.Token
;
import
cn.ibizlab.util.domain.Token
;
import
cn.ibizlab.util.errors.BadRequestAlertException
;
import
cn.ibizlab.util.errors.BadRequestAlertException
;
import
cn.ibizlab.util.helper.CachedBeanCopier
;
import
cn.ibizlab.util.helper.CachedBeanCopier
;
import
cn.ibizlab.util.helper.Sm3Util
;
import
cn.ibizlab.util.security.*
;
import
cn.ibizlab.util.security.*
;
import
cn.ibizlab.util.service.AuthenticationUserService
;
import
cn.ibizlab.util.service.AuthenticationUserService
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
...
@@ -100,6 +101,8 @@ public class ClientAuthenticationResource
...
@@ -100,6 +101,8 @@ public class ClientAuthenticationResource
oldpwd
=
DigestUtils
.
md5DigestAsHex
(
oldpwd
.
getBytes
());
oldpwd
=
DigestUtils
.
md5DigestAsHex
(
oldpwd
.
getBytes
());
else
if
(
pwencrymode
==
2
)
else
if
(
pwencrymode
==
2
)
oldpwd
=
DigestUtils
.
md5DigestAsHex
(
String
.
format
(
"%1$s||%2$s"
,
authenticationUser
.
getUsername
(),
oldpwd
).
getBytes
());
oldpwd
=
DigestUtils
.
md5DigestAsHex
(
String
.
format
(
"%1$s||%2$s"
,
authenticationUser
.
getUsername
(),
oldpwd
).
getBytes
());
else
if
(
pwencrymode
==
3
&&
oldpwd
.
length
()!=
64
)
oldpwd
=
Sm3Util
.
encrypt
(
oldpwd
).
toUpperCase
();
if
(!
sysUser
.
getPassword
().
equals
(
oldpwd
)){
if
(!
sysUser
.
getPassword
().
equals
(
oldpwd
)){
throw
new
BadRequestAlertException
(
"用户名密码错误"
,
"IBZUSER"
,
authenticationUser
.
getUsername
());
throw
new
BadRequestAlertException
(
"用户名密码错误"
,
"IBZUSER"
,
authenticationUser
.
getUsername
());
}
}
...
@@ -108,6 +111,8 @@ public class ClientAuthenticationResource
...
@@ -108,6 +111,8 @@ public class ClientAuthenticationResource
newpwd
=
DigestUtils
.
md5DigestAsHex
(
newpwd
.
getBytes
());
newpwd
=
DigestUtils
.
md5DigestAsHex
(
newpwd
.
getBytes
());
else
if
(
pwencrymode
==
2
)
else
if
(
pwencrymode
==
2
)
newpwd
=
DigestUtils
.
md5DigestAsHex
(
String
.
format
(
"%1$s||%2$s"
,
authenticationUser
.
getUsername
(),
newpwd
).
getBytes
());
newpwd
=
DigestUtils
.
md5DigestAsHex
(
String
.
format
(
"%1$s||%2$s"
,
authenticationUser
.
getUsername
(),
newpwd
).
getBytes
());
else
if
(
pwencrymode
==
3
&&
newpwd
.
length
()!=
64
)
newpwd
=
Sm3Util
.
encrypt
(
newpwd
).
toUpperCase
();
// 修改密码
// 修改密码
sysUser
.
setPassword
(
newpwd
);
sysUser
.
setPassword
(
newpwd
);
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录