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