This commit is contained in:
Maksim Skobaro 2025-06-24 00:39:48 +03:00
parent e15e49f510
commit f11bd838bc
2 changed files with 2 additions and 3 deletions

View File

@ -63,7 +63,6 @@ public class SecurityConfig {
@Primary
public CorsConfigurationSource corsConfiguration(
@Value("${application.domain}") String domain,
@Value("${application.port}") String port,
@Value("${application.protocol}") String protocol
) {
CorsConfiguration corsConfiguration = new CorsConfiguration();
@ -71,7 +70,7 @@ public class SecurityConfig {
corsConfiguration.setAllowedHeaders(List.of("Authorization", "Content-Type"));
corsConfiguration.setAllowCredentials(true);
corsConfiguration.setMaxAge(Duration.ofDays(1));
corsConfiguration.addAllowedOrigin(StringUtils.join(protocol, "://", domain, ":", port));
corsConfiguration.addAllowedOrigin(StringUtils.join(protocol, "://", domain, ":", 443));
if (environment.matchesProfiles("dev")) {
corsConfiguration.addAllowedOrigin("http://localhost:8888");

View File

@ -2,7 +2,7 @@ import axios, {AxiosError, AxiosRequestConfig} from "axios";
import {NotificationService} from "../services/NotificationService";
import {ErrorResponse} from "../models/errorResponse";
export const apiUrl = "http://localhost:8080/api/v1/";
export const apiUrl = "http://vkr.mskobaro.ru:8080/api/v1/";
export const get = async <R>(url: string, data?: any, doReject = true, showError = true) => await request<R>({
url: url,