Browse Source

fix 酷乐秀扫码登录

Eric 2 months ago
parent
commit
66fd790f08

+ 4 - 2
cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/service/impl/CbsQrCodeScanServiceImpl.java

@@ -19,6 +19,7 @@ import org.springframework.stereotype.Service;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import java.util.Map;
 import java.util.Map;
+import java.util.Objects;
 
 
 @Service
 @Service
 public class CbsQrCodeScanServiceImpl {
 public class CbsQrCodeScanServiceImpl {
@@ -44,8 +45,9 @@ public class CbsQrCodeScanServiceImpl {
         if (sysUser == null) {
         if (sysUser == null) {
             throw new BizException(HttpStatus.UNAUTHORIZED.value(), "用户不存在");
             throw new BizException(HttpStatus.UNAUTHORIZED.value(), "用户不存在");
         }
         }
-
-        if (sysUser.getTenantId() == -1L) {
+        // 查询老师机构ID
+        Long tenantId = sysUserService.getTenantByClient(sysUser.getId(), "TEACHER");
+        if (Objects.nonNull(tenantId) && tenantId == -1L) {
             // 平台老师不允许扫码登录乐教通,返回机构ID
             // 平台老师不允许扫码登录乐教通,返回机构ID
             userInfo.setClientTypes("-1");
             userInfo.setClientTypes("-1");
         }
         }