|
@@ -91,10 +91,10 @@ public class UserServiceImpl implements UserService {
|
|
|
public Map<String, Object> addUser(User user) {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
try{
|
|
|
- int count = userMapper.getUserIsNot(user.getUserName());
|
|
|
+ int count = userMapper.getUserIsNot(user);
|
|
|
if(count > 0){
|
|
|
map.put("msg", "510");
|
|
|
- map.put("errMsg", "账号存在");
|
|
|
+ map.put("errMsg", "用户名已存在");
|
|
|
return map;
|
|
|
}
|
|
|
user.setPassword(DesEncry.encrypt(user.getPassword()));
|
|
@@ -132,10 +132,10 @@ public class UserServiceImpl implements UserService {
|
|
|
public Map<String, Object> updateUser(User user) {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
try{
|
|
|
- int count = userMapper.getUserIsNot(user.getUserName());
|
|
|
+ int count = userMapper.getUserIsNot(user);
|
|
|
if(count > 0){
|
|
|
map.put("msg", "510");
|
|
|
- map.put("errMsg", "账号存在");
|
|
|
+ map.put("errMsg", "用户名已存在");
|
|
|
return map;
|
|
|
}
|
|
|
userMapper.updateUser(user);
|