init
This commit is contained in:
@@ -140,7 +140,7 @@ public class CaiLoginManager {
|
||||
}
|
||||
String key = LockManager.getDealInviteLockKey(inviteId);
|
||||
RLock lock = redissonClient.getLock(key);
|
||||
if(!lock.isLocked()){
|
||||
if(lock.isLocked()){
|
||||
log.warn("点击太快了,等一等,dealInviteId");
|
||||
return;
|
||||
}
|
||||
@@ -191,7 +191,7 @@ public class CaiLoginManager {
|
||||
UserInfo userInfo = userInfoService.getById(user.getId());
|
||||
UserInfo update = new UserInfo();
|
||||
update.setUserId(user.getId());
|
||||
update.setLoginCount(userInfo.getLoginCount()+1);
|
||||
update.setLoginCount(userInfo.getLoginCount()==null?0:userInfo.getLoginCount()+1);
|
||||
update.setLastLoginIp(ip);
|
||||
update.setLastLoginTime(LocalDateTime.now());
|
||||
update.setLastLocation(address);
|
||||
@@ -239,7 +239,7 @@ public class CaiLoginManager {
|
||||
String usercode = userCodeGenService.getCodeGen();
|
||||
User add = new User();
|
||||
add.setUsercode(usercode);
|
||||
add.setNickname("蜜瓜"+usercode);
|
||||
add.setNickname("用户"+usercode);
|
||||
add.setType(0);
|
||||
add.setPassword(BCrypt.hashpw(user.getPassword()));
|
||||
add.setMobile(user.getUsername());
|
||||
|
||||
@@ -3,19 +3,25 @@ package com.ruoyi.cai.auth;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
@Data
|
||||
@Schema(description = "注册模型")
|
||||
public class CaiRegisterUser {
|
||||
@Schema(description = "手机号登录名")
|
||||
@NotEmpty(message = "手机号不能为空")
|
||||
private String username;
|
||||
@Schema(description = "密码")
|
||||
@NotEmpty(message = "密码不能为空")
|
||||
private String password;
|
||||
@Schema(description = "密码确认")
|
||||
@NotEmpty(message = "密码确认不能为空")
|
||||
private String passwordCheck;
|
||||
@Schema(description = "验证码")
|
||||
@NotEmpty(message = "验证码不能为空")
|
||||
private String code;
|
||||
@Schema(description = "邀请人ID")
|
||||
private Long inviteId;
|
||||
@Schema(description = "性别")
|
||||
private Integer gender;
|
||||
private Integer gender = 0;
|
||||
}
|
||||
|
||||
@@ -3,11 +3,15 @@ package com.ruoyi.cai.auth;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
@Data
|
||||
@Schema(description = "登陆入参模型")
|
||||
public class LoginCaiUser {
|
||||
@Schema(description = "用户")
|
||||
@NotEmpty(message = "登录名不能为空")
|
||||
private String username;
|
||||
@Schema(description = "密码")
|
||||
@NotEmpty(message = "密码不能为空")
|
||||
private String password;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,10 @@ package com.ruoyi.cai.auth;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
@Data
|
||||
public class RegisterCode {
|
||||
@NotEmpty(message = "手机号不能为空")
|
||||
private String mobile;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user