优化应用权限初始化中的空集合检查
							parent
							
								
									8637771dca
								
							
						
					
					
						commit
						a09c51ba05
					
				| 
						 | 
				
			
			@ -18,6 +18,7 @@ import com.megatron.common.model.RequestContext;
 | 
			
		|||
import lombok.extern.slf4j.Slf4j;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
import org.springframework.util.CollectionUtils;
 | 
			
		||||
 | 
			
		||||
import java.util.HashMap;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
| 
						 | 
				
			
			@ -140,6 +141,7 @@ public class IndexServiceImpl implements IndexService {
 | 
			
		|||
            User user = userRepository.query(requestContext.getTarget());
 | 
			
		||||
            log.info("user:{}", JSON.toJSONString(user));
 | 
			
		||||
            List<AppPerm> permList = JSONArray.parseArray(qxUtils.queryApp(trxToken, user.getUserId()), AppPerm.class);
 | 
			
		||||
            if (!CollectionUtils.isEmpty(permList)) {
 | 
			
		||||
                List<String> appIdList = permList.stream()
 | 
			
		||||
                        .map(AppPerm::getId)
 | 
			
		||||
                        .collect(Collectors.toList());
 | 
			
		||||
| 
						 | 
				
			
			@ -151,6 +153,7 @@ public class IndexServiceImpl implements IndexService {
 | 
			
		|||
                        data.put("enable", "0");
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            log.info("allAppList:{}", JSON.toJSONString(allAppList));
 | 
			
		||||
            return new GeneralResult(true, allAppList, "查询成功");
 | 
			
		||||
        } catch (Exception e) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue