Commit 8c81b31b by wangxing

Merge remote-tracking branch 'origin/master_dg' into master_dg

parents 3f58492e e404c50f
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);
}
}
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment