Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
RuoYi Vue
Commits
a92667c0
Commit
a92667c0
authored
May 20, 2022
by
RuoYi
Browse files
新增获取配置文件中的属性值方法
parent
4a0619ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
ruoyi-common/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java
View file @
a92667c0
...
@@ -143,4 +143,16 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC
...
@@ -143,4 +143,16 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC
final
String
[]
activeProfiles
=
getActiveProfiles
();
final
String
[]
activeProfiles
=
getActiveProfiles
();
return
StringUtils
.
isNotEmpty
(
activeProfiles
)
?
activeProfiles
[
0
]
:
null
;
return
StringUtils
.
isNotEmpty
(
activeProfiles
)
?
activeProfiles
[
0
]
:
null
;
}
}
/**
* 获取配置文件中的值
*
* @param key 配置文件的key
* @return 当前的配置文件的值
*
*/
public
static
String
getRequiredProperty
(
String
key
)
{
return
applicationContext
.
getEnvironment
().
getRequiredProperty
(
key
);
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment