Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xzxt-solr
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
常超
xzxt-solr
Commits
8c81b31b
Commit
8c81b31b
authored
Jun 04, 2020
by
wangxing
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master_dg' into master_dg
parents
3f58492e
e404c50f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
src/main/java/com/cc/config/CrossDomainConfig.java
+21
-0
src/main/resources/spring-mvc.xml
+1
-0
No files found.
src/main/java/com/cc/config/CrossDomainConfig.java
0 → 100644
View file @
8c81b31b
package
com
.
cc
.
config
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.CorsRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
;
/**
* 允许的跨域访问地址。
*/
@Configuration
public
class
CrossDomainConfig
extends
WebMvcConfigurerAdapter
{
@Override
public
void
addCorsMappings
(
CorsRegistry
registry
)
{
registry
.
addMapping
(
"/**"
)
//允许跨域访问的路径
.
allowedHeaders
(
"*"
)
//允许头部设置
.
allowedMethods
(
"POST"
,
"GET"
)
// 允许请求方法
.
allowedOrigins
(
"*"
)
// 允许跨域访问的源
.
allowCredentials
(
true
);
// 是否发送cookie
super
.
addCorsMappings
(
registry
);
}
}
src/main/resources/spring-mvc.xml
View file @
8c81b31b
...
...
@@ -29,6 +29,7 @@
<!-- 不需要拦截的地址 -->
<mvc:exclude-mapping
path=
"/static/**"
/>
<mvc:exclude-mapping
path=
"/relogin"
/>
<mvc:exclude-mapping
path=
"/login"
/>
<bean
class=
"com.cc.HandlerInterceptor.SystemSessionInterceptor"
></bean>
</mvc:interceptor>
</mvc:interceptors>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment