| | |
| | | package com.ruoyi.common.utils.spring; |
| | | |
| | | import cn.hutool.core.lang.Validator; |
| | | import org.springframework.aop.framework.AopContext; |
| | | import org.springframework.beans.BeansException; |
| | | import org.springframework.beans.factory.NoSuchBeanDefinitionException; |
| | |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.ApplicationContextAware; |
| | | import org.springframework.stereotype.Component; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | |
| | | /** |
| | | * spring工具类 方便在非spring管理环境中获取bean |
| | |
| | | public static String getActiveProfile() |
| | | { |
| | | final String[] activeProfiles = getActiveProfiles(); |
| | | return StringUtils.isNotEmpty(activeProfiles) ? activeProfiles[0] : null; |
| | | return Validator.isNotEmpty(activeProfiles) ? activeProfiles[0] : null; |
| | | } |
| | | } |