md5
This commit is contained in:
parent
f3c04ce4eb
commit
642dd588f3
backend/src/main/java/io/metersphere/service
|
@ -11,10 +11,7 @@ import io.metersphere.controller.request.member.AddMemberRequest;
|
||||||
import io.metersphere.controller.request.member.QueryMemberRequest;
|
import io.metersphere.controller.request.member.QueryMemberRequest;
|
||||||
import io.metersphere.controller.request.organization.AddOrgMemberRequest;
|
import io.metersphere.controller.request.organization.AddOrgMemberRequest;
|
||||||
import io.metersphere.controller.request.organization.QueryOrgMemberRequest;
|
import io.metersphere.controller.request.organization.QueryOrgMemberRequest;
|
||||||
import io.metersphere.dto.OrganizationMemberDTO;
|
|
||||||
import io.metersphere.dto.UserDTO;
|
import io.metersphere.dto.UserDTO;
|
||||||
import io.metersphere.dto.UserRoleDTO;
|
|
||||||
import io.metersphere.dto.UserRoleHelpDTO;
|
|
||||||
import io.metersphere.i18n.Translator;
|
import io.metersphere.i18n.Translator;
|
||||||
import io.metersphere.user.SessionUser;
|
import io.metersphere.user.SessionUser;
|
||||||
import io.metersphere.user.SessionUtils;
|
import io.metersphere.user.SessionUtils;
|
||||||
|
@ -23,8 +20,10 @@ import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.*;
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
@ -70,7 +69,8 @@ public class UserService {
|
||||||
user.setUpdateTime(System.currentTimeMillis());
|
user.setUpdateTime(System.currentTimeMillis());
|
||||||
// 默认1:启用状态
|
// 默认1:启用状态
|
||||||
user.setStatus("1");
|
user.setStatus("1");
|
||||||
|
// 密码使用 MD5
|
||||||
|
user.setPassword(CodingUtil.md5(user.getPassword()));
|
||||||
UserExample userExample = new UserExample();
|
UserExample userExample = new UserExample();
|
||||||
UserExample.Criteria criteria = userExample.createCriteria();
|
UserExample.Criteria criteria = userExample.createCriteria();
|
||||||
criteria.andEmailEqualTo(user.getEmail());
|
criteria.andEmailEqualTo(user.getEmail());
|
||||||
|
@ -126,6 +126,8 @@ public class UserService {
|
||||||
public void updateUser(User user) {
|
public void updateUser(User user) {
|
||||||
UserDTO userDTO = getUserDTO(user.getId());
|
UserDTO userDTO = getUserDTO(user.getId());
|
||||||
BeanUtils.copyProperties(user, userDTO);
|
BeanUtils.copyProperties(user, userDTO);
|
||||||
|
// MD5
|
||||||
|
user.setPassword(CodingUtil.md5(user.getPassword()));
|
||||||
SessionUtils.putUser(SessionUser.fromUser(userDTO));
|
SessionUtils.putUser(SessionUser.fromUser(userDTO));
|
||||||
user.setUpdateTime(System.currentTimeMillis());
|
user.setUpdateTime(System.currentTimeMillis());
|
||||||
userMapper.updateByPrimaryKeySelective(user);
|
userMapper.updateByPrimaryKeySelective(user);
|
||||||
|
|
Loading…
Reference in New Issue