mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2025-09-02 02:34:26 +00:00
fix 修复 本地设置环境变量被覆盖问题
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package org.dromara.common.dubbo.config;
|
||||
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
@@ -34,6 +35,10 @@ public class CustomBeanFactoryPostProcessor implements BeanFactoryPostProcessor,
|
||||
*/
|
||||
@Override
|
||||
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
|
||||
String property = System.getProperty("DUBBO_IP_TO_REGISTRY");
|
||||
if (StringUtils.isNotBlank(property)) {
|
||||
return;
|
||||
}
|
||||
// 获取 InetUtils bean,用于获取 IP 地址
|
||||
InetUtils inetUtils = beanFactory.getBean(InetUtils.class);
|
||||
String ip = "127.0.0.1";
|
||||
|
Reference in New Issue
Block a user