Skip to content

Commit

Permalink
Merge pull request #32 from CompPsyUnion/revert-29-xuanzhi33-patch-1
Browse files Browse the repository at this point in the history
Revert "Add CORS"
  • Loading branch information
Pleasurecruise authored Nov 15, 2024
2 parents efcafcc + cb5cd18 commit 4d07627
Showing 1 changed file with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,6 @@ protected void addInterceptors(InterceptorRegistry registry) {
.excludePathPatterns("/student/uniapp/status");
}

// 全局CORS
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("https://gh.xuanzhi33.cn") // 允许特定域名
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") // 允许的HTTP方法
.allowedHeaders("*") // 允许的请求头
.allowCredentials(false) // 禁用Cookie发送
.maxAge(3600); // 预检请求的缓存时间
}

/**
* 通过knife4j生成接口文档
* @return
Expand Down

0 comments on commit 4d07627

Please sign in to comment.