xiaof 3 роки тому
батько
коміт
90186cf354

+ 2 - 6
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ClientServiceImpl.java

@@ -19,8 +19,6 @@ import com.qmth.teachcloud.common.service.TeachcloudCommonService;
 import com.qmth.teachcloud.common.util.ExcelUtil;
 import com.qmth.teachcloud.common.util.ServletUtil;
 import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -38,8 +36,6 @@ import java.util.stream.Collectors;
 @Service
 public class ClientServiceImpl implements ClientService {
 
-    private static final Logger logger = LoggerFactory.getLogger(ClientServiceImpl.class);
-
     @Autowired
     private ExamTaskService examTaskService;
 
@@ -590,8 +586,8 @@ public class ClientServiceImpl implements ClientService {
     @Override
     public void checkPrivilege(Long userId) {
        List<SysPrivilege> sysPrivileges = sysPrivilegeService.getClientUrlByUserId(userId);
-       logger.info("json1111:{}, istrue:{}", JSONObject.toJSONString(sysPrivileges), CollectionUtils.isEmpty(sysPrivileges));
-        if(CollectionUtils.isEmpty(sysPrivileges)){
+        long count = sysPrivileges.stream().filter(m -> "客户端".equals(m.getName()) && "client".equals(m.getUrl())).count();
+        if(count == 0){
             throw ExceptionResultEnum.ERROR.exception("用户没有权限,无法登录");
         }
     }

+ 0 - 1
teachcloud-common/src/main/resources/mapper/SysPrivilegeMapper.xml

@@ -32,7 +32,6 @@
             sys_user_role sur ON srp.role_id = sur.role_id
         WHERE
             sur.user_id = #{userId}
-            and sp.name = '客户端' and sp.url = 'client'
     </select>
 
 </mapper>