|
@@ -184,11 +184,12 @@ public class TenantActivationCodeServiceImpl extends ServiceImpl<TenantActivatio
|
|
|
if (code == null) {
|
|
|
throw new BizException("激活码不存在");
|
|
|
}
|
|
|
- if (Boolean.TRUE.equals(code.getActivationStatus()) || EActivationCode.SEND.equals(code.getSendStatus())) {
|
|
|
+ SysUser sysUser = sysUserMapper.selectById(studentId);
|
|
|
+ if (Boolean.TRUE.equals(code.getActivationStatus()) || (EActivationCode.SEND.equals(code.getSendStatus()) &&
|
|
|
+ !sysUser.getPhone().equals(code.getActivationPhone()))) {
|
|
|
throw new BizException("激活码已经被使用");
|
|
|
}
|
|
|
|
|
|
- SysUser sysUser = sysUserMapper.selectById(studentId);
|
|
|
// 通过状态和ID同时判断更新是否存在竞争
|
|
|
boolean update = this.lambdaUpdate()
|
|
|
.set(TenantActivationCode::getActivationStatus, true)
|