新增自定义CORS配置,修改应用端口为8082,升级jimureport依赖到2.1.5版本

This commit is contained in:
JEECG
2025-10-21 15:26:18 +08:00
parent 1dc6b6cfe6
commit 13411b45b2
3 changed files with 24 additions and 2 deletions

View File

@@ -65,7 +65,7 @@
<dependency>
<groupId>org.jeecgframework.jimureport</groupId>
<artifactId>jimureport-spring-boot3-starter</artifactId>
<version>2.1.3</version>
<version>2.1.5</version>
</dependency>
<!-- mongo、redis和文件数据集支持包按需引入 -->
<dependency>

View File

@@ -0,0 +1,18 @@
package com.jeecg.modules.jmreport.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration("jmCorsConfiguration")
public class CustomCorsConfiguration implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**") // 所有接口
.allowCredentials(true) // 是否发送 Cookie
.allowedOriginPatterns("*") // 支持域
.allowedMethods(new String[]{"GET", "POST", "PUT", "DELETE"}) // 支持方法
.allowedHeaders("*")
.exposedHeaders("*");
}
}

View File

@@ -1,5 +1,5 @@
server:
port: 8085
port: 8082
spring:
#数据库
datasource:
@@ -69,6 +69,10 @@ jeecg:
sender: "???"
username: "??@??.com"
password: "???"
# 是否开启ssl
#ssl: true
# smtp端口
#port: 465
#多租户模式,默认值为空(created:按照创建人隔离、tenant:按照租户隔离)
saasMode:
# 平台上线安全配置