mirror of
https://github.com/Hello-hao/Tbed.git
synced 2026-10-19 16:14:40 +00:00
:memo:调整部分代码
This commit is contained in:
@@ -43,8 +43,6 @@ public static void main(String[] args) {
|
||||
@Bean
|
||||
public static BeanFactoryPostProcessor dependsOnPostProcessor() {
|
||||
return bf -> {
|
||||
// Let beans that need the database depend on the DatabaseStartupValidator
|
||||
// like the JPA EntityManagerFactory or Flyway
|
||||
String[] flyway = bf.getBeanNamesForType(FirstRun.class);
|
||||
Stream.of(flyway)
|
||||
.map(bf::getBeanDefinition)
|
||||
@@ -56,16 +54,11 @@ public static void main(String[] args) {
|
||||
.forEach(it -> it.setDependsOn("databaseStartupValidator"));
|
||||
};
|
||||
}
|
||||
/**
|
||||
* 文件上传配置
|
||||
* @return
|
||||
*/
|
||||
|
||||
@Bean
|
||||
public MultipartConfigElement multipartConfigElement() {
|
||||
MultipartConfigFactory factory = new MultipartConfigFactory();
|
||||
// 单个数据大小
|
||||
factory.setMaxFileSize(DataSize.parse("102400KB")); // KB,MB
|
||||
/// 总上传数据大小
|
||||
return factory.createMultipartConfig();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ public class GetIPS implements Runnable {
|
||||
public static String getIpAddr(HttpServletRequest request){
|
||||
String ip = request.getHeader("X-Forwarded-For");
|
||||
if(org.apache.commons.lang3.StringUtils.isNotEmpty(ip) && !"unKnown".equalsIgnoreCase(ip)){
|
||||
//多次反向代理后会有多个ip值,第一个ip才是真实ip
|
||||
int index = ip.indexOf(",");
|
||||
if(index != -1){
|
||||
return ip.substring(0,index);
|
||||
|
||||
Reference in New Issue
Block a user