Browse Source

1.激活码方式激活指定自己的激活码校验调整

yuanliang 1 năm trước cách đây
mục cha
commit
e7d423cc75

+ 3 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TenantActivationCodeServiceImpl.java

@@ -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)