:memo:调整部分代码

This commit is contained in:
hellohao
2025-01-06 11:00:42 +08:00
parent fe74f47a14
commit c5b288c405
2 changed files with 1 additions and 9 deletions
@@ -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);