|
|
|
@ -200,7 +200,10 @@ public class SysUserController extends BaseController {
|
|
|
|
|
return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
|
|
|
|
|
} else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
|
|
|
|
|
return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
|
|
|
|
}else if(StringUtils.isEmpty(user.getDatasourceId())){
|
|
|
|
|
return error("新增用户'" + user.getUserName() + "'失败,用户数据源不可为空");
|
|
|
|
|
}
|
|
|
|
|
System.out.println("用户:"+user.getUserName()+"数据源ID:"+user.getDatasourceId());
|
|
|
|
|
user.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
|
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
|
|
|
|
return toAjax(userService.insertUser(user));
|
|
|
|
@ -221,7 +224,10 @@ public class SysUserController extends BaseController {
|
|
|
|
|
return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
|
|
|
|
|
} else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
|
|
|
|
|
return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
|
|
|
|
}else if(StringUtils.isEmpty(user.getDatasourceId())){
|
|
|
|
|
return error("修改用户'" + user.getUserName() + "'失败,用户数据源不可为空");
|
|
|
|
|
}
|
|
|
|
|
System.out.println("用户:"+user.getUserName()+"数据源ID:"+user.getDatasourceId());
|
|
|
|
|
user.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
|
return toAjax(userService.updateUser(user));
|
|
|
|
|
}
|
|
|
|
|