BUGFIX:同一浏览器切换版本登录时,密码被置空
This commit is contained in:
@@ -205,6 +205,8 @@ public interface AccountService extends IService<Account> {
|
||||
|
||||
Boolean deleteSubAccount(AddSubAccountDTO addSubAccountDTO);
|
||||
|
||||
void removeSubAccount(AddSubAccountDTO addSubAccountDTO, boolean returnCredits);
|
||||
|
||||
PageBaseResponse<Account> subAccountList(SubAccountPageDTO subAccountPageDTO);
|
||||
|
||||
Account accountDetail(Long id);
|
||||
|
||||
@@ -132,10 +132,12 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
Account account = getOneByEmail(accountDTO.getEmail());
|
||||
//用户有效期校验
|
||||
validateUserValidaExpire(account);
|
||||
if ("Third-000000".equals(account.getUserPassword())) {
|
||||
if ("Third-000000".equals(account.getUserPassword()) && !StringUtil.isNullOrEmpty(accountDTO.getPassword())) {
|
||||
account.setUserPassword(accountDTO.getPassword());
|
||||
accountMapper.updateById(account);
|
||||
} else {
|
||||
} else if ("Third-000000".equals(account.getUserPassword())){
|
||||
throw new BusinessException("Password cannot be empty");
|
||||
} else {
|
||||
if (!account.getUserPassword().equals(accountDTO.getPassword())) {
|
||||
throw new BusinessException("password.error", ResultEnum.PROMPT.getCode());
|
||||
}
|
||||
@@ -1161,10 +1163,14 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
@Override
|
||||
public Boolean designWorksRegister(AccountDesignWorksRegisterDTO accountDesignWorksRegisterDTO) {
|
||||
log.info("注册账号。邮箱:{}", accountDesignWorksRegisterDTO.getUserEmail() );
|
||||
QueryWrapper<Account> qw = new QueryWrapper<>();
|
||||
qw.eq("BINARY user_email", accountDesignWorksRegisterDTO.getUserEmail());
|
||||
List<Account> accountList = accountMapper.selectList(qw);
|
||||
if (CollectionUtil.isNotEmpty(accountList)) {
|
||||
QueryWrapper<Account> qwA = new QueryWrapper<>();
|
||||
qwA.eq("BINARY user_email", accountDesignWorksRegisterDTO.getUserEmail());
|
||||
List<Account> accountList = accountMapper.selectList(qwA);
|
||||
|
||||
QueryWrapper<TrialOrder> qwT = new QueryWrapper<>();
|
||||
qwT.eq("BINARY email", accountDesignWorksRegisterDTO.getUserEmail());
|
||||
List<TrialOrder> trialOrders = trialOrderMapper.selectList(qwT);
|
||||
if (CollectionUtil.isNotEmpty(accountList) || CollectionUtil.isNotEmpty(trialOrders)) {
|
||||
throw new BusinessException("The email has already been registered");
|
||||
}
|
||||
|
||||
@@ -2032,9 +2038,12 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
Account account = accounts.get(0);
|
||||
|
||||
validateUserValidaExpire(account);
|
||||
if ("Third-000000".equals(account.getUserPassword())) {
|
||||
|
||||
if ("Third-000000".equals(account.getUserPassword()) && !StringUtil.isNullOrEmpty(accountDTO.getPassword())) {
|
||||
account.setUserPassword(accountDTO.getPassword());
|
||||
accountMapper.updateById(account);
|
||||
} else if ("Third-000000".equals(account.getUserPassword())){
|
||||
throw new BusinessException("Password cannot be empty");
|
||||
} else {
|
||||
if (!account.getUserPassword().equals(accountDTO.getPassword())) {
|
||||
throw new BusinessException("password.error", ResultEnum.PROMPT.getCode());
|
||||
@@ -2092,14 +2101,16 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
qw.lambda().eq(Account::getUserPassword, accountDTO.getPassword());
|
||||
accounts = accountMapper.selectList(qw);
|
||||
if (CollectionUtil.isEmpty(accounts)) {
|
||||
throw new BusinessException("Password error.");
|
||||
throw new BusinessException("password.error");
|
||||
}
|
||||
Account account = accounts.get(0);
|
||||
|
||||
validateUserValidaExpire(account);
|
||||
if ("Third-000000".equals(account.getUserPassword())) {
|
||||
if ("Third-000000".equals(account.getUserPassword()) && !StringUtil.isNullOrEmpty(accountDTO.getPassword())) {
|
||||
account.setUserPassword(accountDTO.getPassword());
|
||||
accountMapper.updateById(account);
|
||||
} else if ("Third-000000".equals(account.getUserPassword())){
|
||||
throw new BusinessException("Password cannot be empty");
|
||||
} else {
|
||||
if (!account.getUserPassword().equals(accountDTO.getPassword())) {
|
||||
throw new BusinessException("password.error", ResultEnum.PROMPT.getCode());
|
||||
@@ -2192,6 +2203,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
if (isUsernameExists(account.getOrganizationName(), addSubAccountDTO.getUserName())) {
|
||||
throw new BusinessException("This organization already has an account with the same username.");
|
||||
}
|
||||
// 之后是否需要检验密码不能设置为空
|
||||
|
||||
// 校验当前账号邮箱是否有个人账号
|
||||
Account subAccount = accountMapper.selectOne(new QueryWrapper<Account>().eq("user_email", addSubAccountDTO.getUserEmail()));
|
||||
|
||||
Reference in New Issue
Block a user