Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
beauty_ssm
提交
befb250a
B
beauty_ssm
项目概览
爱吃血肠
/
beauty_ssm
通知
9
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
beauty_ssm
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
befb250a
编写于
5月 08, 2018
作者:
爱吃血肠
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
用户在线修改密码
上级
8216a17c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
36 addition
and
1 deletion
+36
-1
src/main/java/com/yingjun/ssm/dao/UserDao.java
src/main/java/com/yingjun/ssm/dao/UserDao.java
+8
-0
src/main/java/com/yingjun/ssm/service/UserService.java
src/main/java/com/yingjun/ssm/service/UserService.java
+7
-0
src/main/java/com/yingjun/ssm/service/impl/UserServiceImpl.java
...in/java/com/yingjun/ssm/service/impl/UserServiceImpl.java
+13
-0
src/main/java/com/yingjun/ssm/web/FindPwdController.java
src/main/java/com/yingjun/ssm/web/FindPwdController.java
+1
-1
src/main/resources/mapper/UserMapper.xml
src/main/resources/mapper/UserMapper.xml
+7
-0
未找到文件。
src/main/java/com/yingjun/ssm/dao/UserDao.java
浏览文件 @
befb250a
...
...
@@ -107,4 +107,12 @@ public interface UserDao {
* @return
*/
public
User
queryUserByUserName
(
@Param
(
"name"
)
String
name
);
/**
* 更新密码通过用户名称即email
* @param email
* @param newPwd
* @return
*/
public
int
updatePasswordByName
(
@Param
(
"name"
)
String
email
,
@Param
(
"password"
)
String
newPwd
);
}
\ No newline at end of file
src/main/java/com/yingjun/ssm/service/UserService.java
浏览文件 @
befb250a
...
...
@@ -129,4 +129,11 @@ public interface UserService {
* @return
*/
public
User
queryUserById
(
String
userEmail
);
/**
* 更新密码通过用户名称即email
* @param email
* @param newPwd
*/
public
void
updatePasswordByName
(
String
email
,
String
newPwd
);
}
\ No newline at end of file
src/main/java/com/yingjun/ssm/service/impl/UserServiceImpl.java
浏览文件 @
befb250a
...
...
@@ -229,4 +229,17 @@ public class UserServiceImpl implements UserService {
return
userDao
.
queryUserByEmails
(
userEmail
);
}
/**
* 更新密码通过用户名称即email
* @param email
* @param newPwd
*/
@Override
public
void
updatePasswordByName
(
String
email
,
String
newPwd
)
{
String
password
=
Md5Util
.
md5Password
(
newPwd
);
if
(
1
!=
userDao
.
updatePasswordByName
(
email
,
newPwd
)){
throw
new
RuntimeException
(
"更新密码通过用户名称即email,更新影响行数不唯一"
);
}
}
}
\ No newline at end of file
src/main/java/com/yingjun/ssm/web/FindPwdController.java
浏览文件 @
befb250a
...
...
@@ -94,7 +94,7 @@ public class FindPwdController {
if
(
email
==
null
){
response
.
sendRedirect
(
"/user/login"
);
}
//
userService.updatePasswordByName(email,newPwd);
userService
.
updatePasswordByName
(
email
,
newPwd
);
}
catch
(
BizException
e
)
{
return
new
BaseResult
<>(
false
,
e
.
getMessage
());
}
catch
(
Exception
e
)
{
...
...
src/main/resources/mapper/UserMapper.xml
浏览文件 @
befb250a
...
...
@@ -172,4 +172,11 @@
where
t_user.name = #{name}
</select>
<!-- 更新密码通过用户名称即email-->
<update
id=
"updatePasswordByName"
>
update t_user set
password=#{password}
where name = #{name}
</update>
</mapper>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录