fix: 优化附件逻辑
This commit is contained in:
parent
101e55a9d2
commit
2c7b5b8bd1
@ -54,6 +54,7 @@ public class SecurityConfig {
|
|||||||
.requestMatchers("/user/login").anonymous()
|
.requestMatchers("/user/login").anonymous()
|
||||||
.requestMatchers("/user/code").permitAll()
|
.requestMatchers("/user/code").permitAll()
|
||||||
.requestMatchers("/sms/resetPassword").permitAll()
|
.requestMatchers("/sms/resetPassword").permitAll()
|
||||||
|
.requestMatchers("/tempFile/**").permitAll()
|
||||||
.requestMatchers("/system/user/auditUser").permitAll()
|
.requestMatchers("/system/user/auditUser").permitAll()
|
||||||
.requestMatchers("/eng/**").permitAll()
|
.requestMatchers("/eng/**").permitAll()
|
||||||
.requestMatchers("/env/**").permitAll()
|
.requestMatchers("/env/**").permitAll()
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import cn.hutool.cache.Cache;
|
|||||||
import cn.hutool.cache.CacheUtil;
|
import cn.hutool.cache.CacheUtil;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.web.cors.CorsConfiguration;
|
import org.springframework.web.cors.CorsConfiguration;
|
||||||
@ -17,6 +18,9 @@ public class WebConfig implements WebMvcConfigurer {
|
|||||||
@Resource
|
@Resource
|
||||||
private FileSpaceProperties fileSpaceProperties;
|
private FileSpaceProperties fileSpaceProperties;
|
||||||
|
|
||||||
|
@Value("${app.zip-import.temp-dir}")
|
||||||
|
private String platformPath;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@ -54,7 +58,8 @@ public class WebConfig implements WebMvcConfigurer {
|
|||||||
|
|
||||||
String systemUrl = "file:" + fileSpaceProperties.getSystem().replace("\\", "/")+"user\\";
|
String systemUrl = "file:" + fileSpaceProperties.getSystem().replace("\\", "/")+"user\\";
|
||||||
registry.addResourceHandler("/avatar/**").addResourceLocations(systemUrl).setCachePeriod(0);
|
registry.addResourceHandler("/avatar/**").addResourceLocations(systemUrl).setCachePeriod(0);
|
||||||
|
String platformUrl = "file:" + platformPath.replace("\\", "/");
|
||||||
|
registry.addResourceHandler("/tempFile/**").addResourceLocations(platformUrl).setCachePeriod(0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -35,9 +35,9 @@ public class ZipFileUtil {
|
|||||||
}
|
}
|
||||||
String os = System.getProperty("os.name").toLowerCase();
|
String os = System.getProperty("os.name").toLowerCase();
|
||||||
if (os.contains("win")) {
|
if (os.contains("win")) {
|
||||||
return "D:\\zip_import_temp";
|
return "D:\\qgc-platform\\zip_import_temp";
|
||||||
} else {
|
} else {
|
||||||
return "/tmp/zip_import_temp";
|
return "/qgc-platform/tmp/zip_import_temp";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -55,7 +55,7 @@ login:
|
|||||||
app:
|
app:
|
||||||
# ZIP导入临时目录配置
|
# ZIP导入临时目录配置
|
||||||
zip-import:
|
zip-import:
|
||||||
temp-dir: ${ZIP_IMPORT_TEMP_DIR:D:\zip_import_temp}
|
temp-dir: ${ZIP_IMPORT_TEMP_DIR:D:\qgc-platform\zip_import_temp}
|
||||||
init:
|
init:
|
||||||
enabled: false
|
enabled: false
|
||||||
schema: classpath:db-init/sql/min-schema.sql
|
schema: classpath:db-init/sql/min-schema.sql
|
||||||
@ -82,8 +82,8 @@ ip:
|
|||||||
|
|
||||||
|
|
||||||
file-space: #项目文档空间
|
file-space: #项目文档空间
|
||||||
files: D:\demoproject\files\ #单独上传的文件附件
|
files: D:\qgc-platform\files\ #单独上传的文件附件
|
||||||
system: D:\demoproject\system\ #单独上传的文件
|
system: D:\qgc-platform\system\ #单独上传的文件
|
||||||
|
|
||||||
task:
|
task:
|
||||||
pool:
|
pool:
|
||||||
|
|||||||
@ -77,7 +77,7 @@ login:
|
|||||||
app:
|
app:
|
||||||
# ZIP导入临时目录配置
|
# ZIP导入临时目录配置
|
||||||
zip-import:
|
zip-import:
|
||||||
temp-dir: ${ZIP_IMPORT_TEMP_DIR:D:\zip_import_temp}
|
temp-dir: ${ZIP_IMPORT_TEMP_DIR:D:\qgc-platform\zip_import_temp}
|
||||||
init:
|
init:
|
||||||
enabled: false
|
enabled: false
|
||||||
schema: classpath:db-init/sql/min-schema.sql
|
schema: classpath:db-init/sql/min-schema.sql
|
||||||
|
|||||||
@ -77,7 +77,7 @@ login:
|
|||||||
app:
|
app:
|
||||||
# ZIP导入临时目录配置
|
# ZIP导入临时目录配置
|
||||||
zip-import:
|
zip-import:
|
||||||
temp-dir: ${ZIP_IMPORT_TEMP_DIR:/tmp/zip_import_temp}
|
temp-dir: ${ZIP_IMPORT_TEMP_DIR:/qgc-platform/tmp/zip_import_temp}
|
||||||
init:
|
init:
|
||||||
enabled: false
|
enabled: false
|
||||||
schema: classpath:db-init/sql/min-schema.sql
|
schema: classpath:db-init/sql/min-schema.sql
|
||||||
@ -104,8 +104,8 @@ ip:
|
|||||||
|
|
||||||
|
|
||||||
file-space: #项目文档空间
|
file-space: #项目文档空间
|
||||||
files: D:\demoproject\files\ #单独上传的文件附件
|
files: /qgc-platform/files/ #单独上传的文件附件
|
||||||
system: D:\demoproject\system\ #单独上传的文件
|
system: /qgc-platform/system/ #单独上传的文件
|
||||||
|
|
||||||
task:
|
task:
|
||||||
pool:
|
pool:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user