ソースを参照

跨机构不允许注册

zouxuan 3 年 前
コミット
6d4f9294ab

+ 4 - 1
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/core/provider/PhoneAuthenticationProvider.java

@@ -81,7 +81,10 @@ public class PhoneAuthenticationProvider extends AbstractAuthenticationProvider
 			if (user == null) {
 				throw new LockedException("用户不存在");
 			}
-			
+			//如果机构不一致,不允许跨机构注册
+			if(!loginEntity.getTenantId().equals(user.getTenantId())){
+				throw new LockedException("用户已注册");
+			}
 			if (StringUtils.isNotBlank(deviceNum)) {
 				sysUserDeviceService.bindDevice(clientId, user.getId(), deviceNum);
 			}