修改密码
This commit is contained in:
parent
867225673b
commit
92704173dd
|
@ -32,6 +32,7 @@
|
|||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--修改密码-->
|
||||
<update id="updatePassword" parameterType="io.metersphere.base.domain.User">
|
||||
update user
|
||||
|
|
|
@ -9,8 +9,8 @@ import io.metersphere.commons.utils.PageUtils;
|
|||
import io.metersphere.commons.utils.Pager;
|
||||
import io.metersphere.controller.request.UserRequest;
|
||||
import io.metersphere.controller.request.member.AddMemberRequest;
|
||||
import io.metersphere.controller.request.member.QueryMemberRequest;
|
||||
import io.metersphere.controller.request.member.EditPassWordRequest;
|
||||
import io.metersphere.controller.request.member.QueryMemberRequest;
|
||||
import io.metersphere.controller.request.organization.AddOrgMemberRequest;
|
||||
import io.metersphere.controller.request.organization.QueryOrgMemberRequest;
|
||||
import io.metersphere.dto.UserDTO;
|
||||
|
@ -250,6 +250,7 @@ public class UserController {
|
|||
public List<User> getBesideOrgMemberList(@PathVariable String orgId) {
|
||||
return userService.getBesideOrgMemberList(orgId);
|
||||
}
|
||||
|
||||
/*
|
||||
* 修改当前用户密码
|
||||
* */
|
||||
|
@ -257,6 +258,7 @@ public class UserController {
|
|||
public int updateCurrentUserPassword(@RequestBody EditPassWordRequest request) {
|
||||
return userService.updateCurrentUserPassword(request);
|
||||
}
|
||||
|
||||
/*管理员修改用户密码*/
|
||||
@PostMapping("/special/password")
|
||||
public int updateUserPassword(@RequestBody EditPassWordRequest request) {
|
||||
|
|
|
@ -277,6 +277,7 @@ public class UserService {
|
|||
userMapper.updateByPrimaryKeySelective(newUser);
|
||||
}
|
||||
|
||||
|
||||
/*修改当前用户用户密码*/
|
||||
private User updateCurrentUserPwd(EditPassWordRequest request) {
|
||||
if (SessionUtils.getUser() != null) {
|
||||
|
@ -300,6 +301,7 @@ public class UserService {
|
|||
User user = updateCurrentUserPwd(request);
|
||||
return extUserMapper.updatePassword(user);
|
||||
}
|
||||
|
||||
/*管理员修改用户密码*/
|
||||
private User updateUserPwd(EditPassWordRequest request) {
|
||||
User user = userMapper.selectByPrimaryKey(request.getId());
|
||||
|
@ -308,6 +310,7 @@ public class UserService {
|
|||
user.setUpdateTime(System.currentTimeMillis());
|
||||
return user;
|
||||
}
|
||||
|
||||
public int updateUserPassword(EditPassWordRequest request) {
|
||||
User user = updateUserPwd(request);
|
||||
return extUserMapper.updatePassword(user);
|
||||
|
|
Loading…
Reference in New Issue