fix
This commit is contained in:
parent
ac5c66199b
commit
6aaab95126
@ -12,10 +12,12 @@ public class CorsConfig implements WebMvcConfigurer {
|
|||||||
@Override
|
@Override
|
||||||
public void addCorsMappings(CorsRegistry registry) {
|
public void addCorsMappings(CorsRegistry registry) {
|
||||||
registry.addMapping("/**")
|
registry.addMapping("/**")
|
||||||
.allowedOrigins("*") // 推荐指定为 "chrome-extension://<插件ID>",测试可用 "*"
|
.allowedOriginPatterns("*") // 或指定域名如 https://admin.wisdompulse.cn
|
||||||
.allowedMethods("POST", "GET", "OPTIONS")
|
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
|
||||||
.allowedHeaders("*")
|
.allowedHeaders("*")
|
||||||
.allowCredentials(false); // POST 请求建议设置 false,避免携带 cookie
|
.allowCredentials(true)
|
||||||
|
.maxAge(3600);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user