6 changed files with 63 additions and 48 deletions
-
17lottery-system/lottery-common/src/main/java/com/lottery/exception/GlobalExceptionHandler.java
-
12lottery-system/lottery-service/src/main/java/com/lottery/api/controller/ApiFundingController.java
-
14lottery-system/lottery-service/src/main/java/com/lottery/api/service/Impl/ApiFundingServiceImpl.java
-
32lottery-system/lottery-service/src/main/java/com/lottery/config/CorsConfig.java
-
13lottery-system/lottery-service/src/main/java/com/lottery/config/WebConfig.java
-
23lottery-system/lottery-service/src/main/java/com/lottery/interceptor/AuthInterceptor.java
@ -1,32 +0,0 @@ |
|||
package com.lottery.config; |
|||
|
|||
import org.springframework.context.annotation.Configuration; |
|||
import org.springframework.web.servlet.config.annotation.CorsRegistry; |
|||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
|||
|
|||
/** |
|||
* @program: lottery |
|||
* @ClassName CorsConfig |
|||
* @description: |
|||
* @author: wwl |
|||
* @create: 2025-07-18 10:21 |
|||
* @Version 1.0 |
|||
**/ |
|||
|
|||
@Configuration |
|||
public class CorsConfig implements WebMvcConfigurer { |
|||
@Override |
|||
public void addCorsMappings(CorsRegistry registry) { |
|||
// registry.addMapping("/**") |
|||
// .allowedOrigins("*") // 允许所有来源 |
|||
// .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") |
|||
// .allowedHeaders("*"); |
|||
|
|||
registry.addMapping("/**") |
|||
.allowedOriginPatterns("*") // 允许所有来源模式 |
|||
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") |
|||
.allowedHeaders("*") |
|||
.allowCredentials(true); // 允许携带凭证(如cookie、认证头) |
|||
|
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue