use of com.ruoyi.system.api.domain.SysUser in project RuoYi-Cloud-Plus by JavaLionLi.
the class SysUserServiceImpl method checkUserDataScope.
/**
* 校验用户是否有数据权限
*
* @param userId 用户id
*/
@Override
public void checkUserDataScope(Long userId) {
if (!LoginHelper.isAdmin()) {
SysUser user = new SysUser();
user.setUserId(userId);
List<SysUser> users = this.selectUserList(user);
if (CollUtil.isEmpty(users)) {
throw new ServiceException("没有权限访问用户数据!");
}
}
}
use of com.ruoyi.system.api.domain.SysUser in project RuoYi-Cloud-Plus by JavaLionLi.
the class RemoteUserServiceImpl method getUserInfoByOpenid.
@Override
public XcxLoginUser getUserInfoByOpenid(String openid) throws UserException {
// todo 自行实现 userService.selectUserByOpenid(openid);
SysUser sysUser = new SysUser();
if (ObjectUtil.isNull(sysUser)) {
// todo 用户不存在 业务逻辑自行实现
}
if (UserStatus.DELETED.getCode().equals(sysUser.getDelFlag())) {
// todo 用户已被删除 业务逻辑自行实现
}
if (UserStatus.DISABLE.getCode().equals(sysUser.getStatus())) {
// todo 用户已被停用 业务逻辑自行实现
}
// 此处可根据登录用户的数据不同 自行创建 loginUser
XcxLoginUser loginUser = new XcxLoginUser();
loginUser.setUserId(sysUser.getUserId());
loginUser.setUsername(sysUser.getUserName());
loginUser.setUserType(sysUser.getUserType());
loginUser.setOpenid(openid);
return loginUser;
}
Aggregations