Merge framework directory from develop-business-css into develop-framework
This commit is contained in:
parent
4bae2b7c03
commit
e8f1f576bf
@ -27,7 +27,7 @@ export default ({ mode }: ConfigEnv): UserConfig => {
|
|||||||
// 线上API地址
|
// 线上API地址
|
||||||
//target: 'http://192.168.1.20:8090/',
|
//target: 'http://192.168.1.20:8090/',
|
||||||
// 本地API地址
|
// 本地API地址
|
||||||
target: 'http://localhost:8093',
|
target: 'http://localhost:8090',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: path =>
|
rewrite: path =>
|
||||||
path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')
|
path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import java.io.IOException;
|
|||||||
* 例如:/prod-api/user/code -> /user/code
|
* 例如:/prod-api/user/code -> /user/code
|
||||||
* 这样可以兼容前端生产环境仍使用 /prod-api 作为网关前缀的情况。
|
* 这样可以兼容前端生产环境仍使用 /prod-api 作为网关前缀的情况。
|
||||||
*/
|
*/
|
||||||
@WebFilter(urlPatterns = "/prod-api/*", filterName = "prodApiPrefixFilter", asyncSupported = true)
|
@WebFilter(urlPatterns = "/prod-api/*", filterName = "prodApiPrefixFilter")
|
||||||
public class ProdApiPrefixFilter implements Filter {
|
public class ProdApiPrefixFilter implements Filter {
|
||||||
|
|
||||||
private static final String PREFIX = "/prod-api";
|
private static final String PREFIX = "/prod-api";
|
||||||
|
|||||||
@ -55,10 +55,9 @@ public class SecurityConfig {
|
|||||||
.requestMatchers("/user/code").permitAll()
|
.requestMatchers("/user/code").permitAll()
|
||||||
.requestMatchers(HttpMethod.GET,
|
.requestMatchers(HttpMethod.GET,
|
||||||
"/*.html",
|
"/*.html",
|
||||||
"/**/*.html",
|
"/webSocket/**",
|
||||||
"/**/*.css",
|
"/assets/**",
|
||||||
"/**/*.js",
|
"/icon/**").permitAll()
|
||||||
"/webSocket/**").permitAll()
|
|
||||||
.requestMatchers(
|
.requestMatchers(
|
||||||
"/swagger-ui.html",
|
"/swagger-ui.html",
|
||||||
"/swagger-ui/**",
|
"/swagger-ui/**",
|
||||||
@ -74,7 +73,6 @@ public class SecurityConfig {
|
|||||||
"/avatar/**",
|
"/avatar/**",
|
||||||
"/systemurl/**",
|
"/systemurl/**",
|
||||||
"/api/imageserver/upload").permitAll()
|
"/api/imageserver/upload").permitAll()
|
||||||
.requestMatchers("/**/**").permitAll()
|
|
||||||
.anyRequest().authenticated()
|
.anyRequest().authenticated()
|
||||||
)
|
)
|
||||||
.cors(cors -> {});
|
.cors(cors -> {});
|
||||||
|
|||||||
@ -41,10 +41,13 @@ public class WebConfig implements WebMvcConfigurer {
|
|||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
@Override
|
@Override
|
||||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||||
// 菜单图标访问路径
|
registry.addResourceHandler("/icon/**")
|
||||||
String iconUrl = "file:" + System.getProperty("user.dir") + "\\src" +
|
.addResourceLocations("classpath:/static/icon/")
|
||||||
"\\main\\resources\\static\\icon\\";
|
.setCachePeriod(0);
|
||||||
registry.addResourceHandler("/menu/**").addResourceLocations(iconUrl).setCachePeriod(0);
|
|
||||||
|
registry.addResourceHandler("/assets/**")
|
||||||
|
.addResourceLocations("classpath:/static/assets/")
|
||||||
|
.setCachePeriod(0);
|
||||||
|
|
||||||
registry.addResourceHandler("swagger-ui.html").addResourceLocations(
|
registry.addResourceHandler("swagger-ui.html").addResourceLocations(
|
||||||
"classpath:/META-INF/resources/");
|
"classpath:/META-INF/resources/");
|
||||||
|
|||||||
@ -26,11 +26,18 @@ public class DynamicDataSourceConfig {
|
|||||||
return DruidDataSourceBuilder.create().build();
|
return DruidDataSourceBuilder.create().build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@ConfigurationProperties("spring.datasource.druid.slave")
|
||||||
|
public DataSource wglSlaveDataSource(){
|
||||||
|
return DruidDataSourceBuilder.create().build();
|
||||||
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@Primary
|
@Primary
|
||||||
public DynamicDataSource dataSource(DataSource wglMasterDataSource, DataSource wglSlaveDataSource) {
|
public DynamicDataSource dataSource(DataSource wglMasterDataSource, DataSource wglSlaveDataSource) {
|
||||||
Map<Object, Object> targetDataSources = new HashMap<>();
|
Map<Object, Object> targetDataSources = new HashMap<>();
|
||||||
targetDataSources.put("master",wglMasterDataSource);
|
targetDataSources.put("master",wglMasterDataSource);
|
||||||
|
targetDataSources.put("slave",wglSlaveDataSource);
|
||||||
return new DynamicDataSource(wglMasterDataSource, targetDataSources);
|
return new DynamicDataSource(wglMasterDataSource, targetDataSources);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
server:
|
server:
|
||||||
port: 8093
|
port: 8090
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
#应用名称
|
#应用名称
|
||||||
@ -10,12 +10,12 @@ spring:
|
|||||||
druid:
|
druid:
|
||||||
master:
|
master:
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://43.138.168.68:3306/frameworkdb2023?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true
|
url: jdbc:mysql://43.138.168.68:3306/businessdb_css?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true
|
||||||
username: root
|
username: root
|
||||||
password: ylfw20230626@
|
password: ylfw20230626@
|
||||||
slave:
|
slave:
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://43.138.168.68:3306/frameworkdb2023?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true
|
url: jdbc:mysql://43.138.168.68:3306/businessdb_css?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true
|
||||||
username: root
|
username: root
|
||||||
password: ylfw20230626@
|
password: ylfw20230626@
|
||||||
|
|
||||||
|
|||||||
30
framework/src/main/resources/application-framework.yml
Normal file
30
framework/src/main/resources/application-framework.yml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
jasypt:
|
||||||
|
encryptor:
|
||||||
|
password: salt
|
||||||
|
|
||||||
|
# 密码加密传输,前端公钥加密,后端私钥解密(共性配置)
|
||||||
|
rsa:
|
||||||
|
private_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A==
|
||||||
|
|
||||||
|
# Actuator & Micrometer 默认配置(共性)
|
||||||
|
management:
|
||||||
|
endpoints:
|
||||||
|
web:
|
||||||
|
exposure:
|
||||||
|
include: health,info,metrics,prometheus,env,beans,threaddump,loggers,configprops
|
||||||
|
endpoint:
|
||||||
|
health:
|
||||||
|
show-details: always
|
||||||
|
metrics:
|
||||||
|
tags:
|
||||||
|
application: ${spring.application.name:platform}
|
||||||
|
|
||||||
|
|
||||||
|
# Springdoc 默认配置(共性)
|
||||||
|
springdoc:
|
||||||
|
api-docs:
|
||||||
|
enabled: true
|
||||||
|
swagger-ui:
|
||||||
|
enabled: true
|
||||||
|
path: /swagger-ui.html
|
||||||
|
packages-to-scan: com.yfd.platform
|
||||||
@ -37,7 +37,6 @@ swagger-ui:
|
|||||||
|
|
||||||
file-space: #项目文档空间
|
file-space: #项目文档空间
|
||||||
files: D:\demoproject\files\ #单独上传的文件附件
|
files: D:\demoproject\files\ #单独上传的文件附件
|
||||||
3dmodel: D:\demoproject\3dmodel\ #单独上传的文件附件
|
|
||||||
useravatar: D:\demoproject\useravatar\ #用户头像
|
useravatar: D:\demoproject\useravatar\ #用户头像
|
||||||
system: D:\demoproject\system\ #系统文档根目录,用于头像等静态资源
|
system: D:\demoproject\system\ #系统文档根目录,用于头像等静态资源
|
||||||
|
|
||||||
|
|||||||
@ -22,9 +22,7 @@ management:
|
|||||||
metrics:
|
metrics:
|
||||||
tags:
|
tags:
|
||||||
application: ${spring.application.name:platform}
|
application: ${spring.application.name:platform}
|
||||||
export:
|
|
||||||
prometheus:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
# Springdoc 默认配置
|
# Springdoc 默认配置
|
||||||
springdoc:
|
springdoc:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user