mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2026-04-26 21:59:37 +08:00
add 增加 邮箱验证码发送接口
add 增加 邮箱登陆接口
This commit is contained in:
@@ -66,6 +66,21 @@ public class RemoteUserServiceImpl implements RemoteUserService {
|
||||
return buildLoginUser(userMapper.selectUserByPhonenumber(phonenumber));
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoginUser getUserInfoByEmail(String email) throws UserException {
|
||||
SysUser user = userMapper.selectOne(new LambdaQueryWrapper<SysUser>()
|
||||
.select(SysUser::getPhonenumber, SysUser::getStatus)
|
||||
.eq(SysUser::getEmail, email));
|
||||
if (ObjectUtil.isNull(user)) {
|
||||
throw new UserException("user.not.exists", email);
|
||||
}
|
||||
if (UserStatus.DISABLE.getCode().equals(user.getStatus())) {
|
||||
throw new UserException("user.blocked", email);
|
||||
}
|
||||
// 此处可根据登录用户的数据不同 自行创建 loginUser
|
||||
return buildLoginUser(userMapper.selectUserByEmail(email));
|
||||
}
|
||||
|
||||
@Override
|
||||
public XcxLoginUser getUserInfoByOpenid(String openid) throws UserException {
|
||||
// todo 自行实现 userService.selectUserByOpenid(openid);
|
||||
|
||||
@@ -77,6 +77,14 @@ public interface SysUserMapper extends BaseMapperPlus<SysUserMapper, SysUser, Sy
|
||||
*/
|
||||
SysUser selectUserByPhonenumber(String phonenumber);
|
||||
|
||||
/**
|
||||
* 通过邮箱查询用户
|
||||
*
|
||||
* @param email 邮箱
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
SysUser selectUserByEmail(String email);
|
||||
|
||||
/**
|
||||
* 通过用户ID查询用户
|
||||
*
|
||||
|
||||
@@ -126,6 +126,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where u.del_flag = '0' and u.phonenumber = #{phonenumber}
|
||||
</select>
|
||||
|
||||
<select id="selectUserByEmail" parameterType="String" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.del_flag = '0' and u.email = #{email}
|
||||
</select>
|
||||
|
||||
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.del_flag = '0' and u.user_id = #{userId}
|
||||
|
||||
Reference in New Issue
Block a user