feat: cors
This commit is contained in:
parent
176b1554e9
commit
c854debbe7
@ -26,7 +26,7 @@ public class WebConfiguration implements WebMvcConfigurer {
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry
|
||||
.addMapping("/**")
|
||||
.allowedOrigins("https://i11a701.p.ssafy.io/", "http://localhost:5173", "http://localhost:4173","http://localhost:5080")
|
||||
.allowedOrigins("https://i11a701.p.ssafy.io/", "http://localhost:5173", "http://localhost:4173","http://localhost:5080","http://192.168.*:5173")
|
||||
.allowedMethods(HttpMethod.GET.name(), HttpMethod.POST.name(), HttpMethod.PUT.name(),
|
||||
HttpMethod.DELETE.name(), HttpMethod.HEAD.name(), HttpMethod.OPTIONS.name(),
|
||||
HttpMethod.PATCH.name())
|
||||
@ -35,6 +35,7 @@ public class WebConfiguration implements WebMvcConfigurer {
|
||||
.maxAge(1800); // Pre-flight Caching
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
registry.addResourceHandler("/img/**").addResourceLocations("classpath:/static/assets/img/");
|
||||
|
@ -35,6 +35,8 @@ public class UserController {
|
||||
public ResponseEntity<String> join(@RequestBody User user) throws Exception {
|
||||
|
||||
|
||||
System.out.println("@@@@@");
|
||||
log.info("@@@@@@@@@@@@@@@@");
|
||||
userService.join(user);
|
||||
return ResponseEntity.ok("User registered successfully");
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ public class UserServiceImpl implements UserService {
|
||||
|
||||
|
||||
private final UserRepository userRepository;
|
||||
private final JavaMailSender mailSender;
|
||||
private final JavaMailSender mailSender;//private final PasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
|
||||
|
||||
|
||||
public void join(User user)
|
||||
|
Loading…
Reference in New Issue
Block a user