Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yujianwangzivayy
MaxKey
提交
78629720
MaxKey
项目概览
yujianwangzivayy
/
MaxKey
与 Fork 源项目一致
Fork自
MaxKey单点登录官方(MaxKeyTop) / MaxKey
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MaxKey
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
78629720
编写于
12月 08, 2019
作者:
MaxKey单点登录官方
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
changeUserPassword fix
上级
1182fc35
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
19 addition
and
20 deletion
+19
-20
maxkey-dao/src/main/java/org/maxkey/dao/service/UserInfoService.java
...src/main/java/org/maxkey/dao/service/UserInfoService.java
+4
-0
maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/SafeController.java
...c/main/java/org/maxkey/web/contorller/SafeController.java
+8
-5
maxkey-web-maxkey/src/main/resources/templates/views/layout/nav_primary.ftl
...src/main/resources/templates/views/layout/nav_primary.ftl
+5
-3
maxkey-web-maxkey/src/main/resources/templates/views/safe/changeAppLoginPasswod.ftl
.../resources/templates/views/safe/changeAppLoginPasswod.ftl
+1
-6
maxkey-web-maxkey/src/main/resources/templates/views/safe/changePassword.ftl
...rc/main/resources/templates/views/safe/changePassword.ftl
+1
-6
未找到文件。
maxkey-dao/src/main/java/org/maxkey/dao/service/UserInfoService.java
浏览文件 @
78629720
...
...
@@ -10,6 +10,8 @@ import org.maxkey.domain.UserInfo;
import
org.maxkey.util.DateUtils
;
import
org.maxkey.util.StringUtils
;
import
org.maxkey.web.WebContext
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.crypto.password.PasswordEncoder
;
import
org.springframework.stereotype.Service
;
...
...
@@ -21,6 +23,7 @@ import org.springframework.stereotype.Service;
*/
@Service
public
class
UserInfoService
extends
JpaBaseService
<
UserInfo
>
{
final
static
Logger
_logger
=
LoggerFactory
.
getLogger
(
UserInfoService
.
class
);
@Autowired
private
PasswordEncoder
passwordEncoder
;
...
...
@@ -107,6 +110,7 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
}
String
password
=
passwordEncoder
.
encode
(
PasswordReciprocal
.
getInstance
().
rawPassword
(
userInfo
.
getUsername
(),
userInfo
.
getPassword
()));
userInfo
.
setDecipherable
(
PasswordReciprocal
.
getInstance
().
rawPassword
(
userInfo
.
getUsername
(),
userInfo
.
getPassword
()));
_logger
.
debug
(
"decipherable : "
+
userInfo
.
getDecipherable
());
userInfo
.
setPassword
(
password
);
userInfo
.
setPasswordLastSetTime
(
DateUtils
.
getCurrentDateTimeAsString
());
...
...
maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/SafeController.java
浏览文件 @
78629720
...
...
@@ -46,10 +46,11 @@ public class SafeController {
@RequestParam
(
"newPassword"
)
String
newPassword
,
@RequestParam
(
"confirmPassword"
)
String
confirmPassword
)
{
changeUserPassword
(
oldPassword
,
newPassword
,
confirmPassword
);
return
new
Message
(
WebContext
.
getI18nValue
(
OPERATEMESSAGE
.
UPDATE_ERROR
),
MessageType
.
error
);
if
(
changeUserPassword
(
oldPassword
,
newPassword
,
confirmPassword
))
{
return
new
Message
(
WebContext
.
getI18nValue
(
OPERATEMESSAGE
.
UPDATE_SUCCESS
),
MessageType
.
success
);
}
else
{
return
new
Message
(
WebContext
.
getI18nValue
(
OPERATEMESSAGE
.
UPDATE_ERROR
),
MessageType
.
error
);
}
}
@RequestMapping
(
value
=
"/changeExpiredPassword"
)
...
...
@@ -91,9 +92,11 @@ public class SafeController {
String
newPassword
,
String
confirmPassword
){
UserInfo
userInfo
=
WebContext
.
getUserInfo
();
_logger
.
debug
(
"decipherable : "
+
userInfo
.
getDecipherable
());
_logger
.
debug
(
"decipherable : "
+
PasswordReciprocal
.
getInstance
().
rawPassword
(
userInfo
.
getUsername
(),
userInfo
.
getPassword
()));
if
(
newPassword
.
equals
(
confirmPassword
)){
if
(
oldPassword
==
null
||
userInfo
.
getPassword
().
equals
(
passwordEncoder
.
encode
(
PasswordReciprocal
.
getInstance
().
rawPassword
(
userInfo
.
getUsername
(),
oldPassword
)
))){
passwordEncoder
.
matches
(
PasswordReciprocal
.
getInstance
().
rawPassword
(
userInfo
.
getUsername
(),
oldPassword
),
userInfo
.
getPassword
(
))){
userInfo
.
setPassword
(
newPassword
);
userInfoService
.
changePassword
(
userInfo
);
//TODO syncProvisioningService.changePassword(userInfo);
...
...
maxkey-web-maxkey/src/main/resources/templates/views/layout/nav_primary.ftl
浏览文件 @
78629720
...
...
@@ -4,9 +4,6 @@
<li id="nav_primay_11" class="nav_primay_level primaryleft" xpath="">
<a href="<@base/>/appList">我的应用</a>
</li>
<li id="nav_primay_12" class="nav_primay_level primaryleft" xpath="">
<a href="<@base/>/socialsignon/list">认证关联</a>
</li>
<li id="nav_primay_13" class="nav_primay_level primaryleft" xpath="">
<a href="<@base/>/safe/forward/setting">安全设置</a>
<div id="nav_child_1301" class="nav_second_child">
...
...
@@ -15,6 +12,11 @@
<a href="<@base/>/safe/forward/setting">安全设置</a>
</li>
</ul>
<ul>
<li id="nav_second_1301" class="nav_second_level">
<a href="<@base/>/socialsignon/list">认证关联</a>
</li>
</ul>
<ul>
<li id="nav_second_1302" class="nav_second_level">
<a href="<@base/>/safe/forward/changePasswod">密码修改</a>
...
...
maxkey-web-maxkey/src/main/resources/templates/views/safe/changeAppLoginPasswod.ftl
浏览文件 @
78629720
...
...
@@ -37,24 +37,19 @@
<th><
@
locale
code=
"login.password.oldPassword"
/>
:
</th>
<td>
<input
class=
"form-control"
type=
"password"
id=
"oldPassword"
name=
"oldPassword"
class=
"required"
title=
""
value=
""
/>
<b
class=
"orange"
>
*
</b>
<label
for=
"oldPassword"
></label>
</td>
</tr>
<tr>
<th><
@
locale
code=
"login.password.newPassword"
/>
:
</th>
<td>
<input
class=
"form-control"
type=
"password"
id=
"newPassword"
name=
"newPassword"
class=
" required"
title=
""
value=
""
/>
<b
class=
"orange"
>
*
</b>
<label
for=
"newPassword"
></label>
</td>
</tr>
<tr>
<th><
@
locale
code=
"login.password.confirmPassword"
/>
:
</th>
<td
nowrap
>
<input
class=
"form-control"
type=
"password"
id=
"confirmPassword"
name=
"confirmPassword"
class=
"{ required: true, equalTo: '#newPassword' }"
title=
""
value=
""
/>
<b
class=
"orange"
>
*
</b>
<label
for=
"confirmPassword"
></label>
</td>
</tr>
<tr>
...
...
maxkey-web-maxkey/src/main/resources/templates/views/safe/changePassword.ftl
浏览文件 @
78629720
...
...
@@ -37,24 +37,19 @@
<th><
@
locale
code=
"login.password.oldPassword"
/>
:
</th>
<td>
<input
class=
"form-control"
type=
"password"
id=
"oldPassword"
name=
"oldPassword"
class=
"required"
title=
""
value=
""
/>
<b
class=
"orange"
>
*
</b>
<label
for=
"oldPassword"
></label>
</td>
</tr>
<tr>
<th><
@
locale
code=
"login.password.newPassword"
/>
:
</th>
<td>
<input
class=
"form-control"
type=
"password"
id=
"newPassword"
name=
"newPassword"
class=
" required"
title=
""
value=
""
/>
<b
class=
"orange"
>
*
</b>
<label
for=
"newPassword"
></label>
</td>
</tr>
<tr>
<th><
@
locale
code=
"login.password.confirmPassword"
/>
:
</th>
<td
nowrap
>
<input
class=
"form-control"
type=
"password"
id=
"confirmPassword"
name=
"confirmPassword"
class=
"{ required: true, equalTo: '#newPassword' }"
title=
""
value=
""
/>
<b
class=
"orange"
>
*
</b>
<label
for=
"confirmPassword"
></label>
</td>
</tr>
<tr>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录