From 13375abf24cfc026cb335695ad7431f6bdc95a56 Mon Sep 17 00:00:00 2001 From: Ivan Date: Wed, 28 May 2025 17:37:06 +0300 Subject: [PATCH] weather url fix --- .env | 10 +- src/components/carrierinfo.vue | 587 +++++++++++++++++++++++++++++++++ src/components/weatherinfo.vue | 11 +- src/config.js | 1 + 4 files changed, 598 insertions(+), 11 deletions(-) diff --git a/.env b/.env index 33cf802..6c873d1 100644 --- a/.env +++ b/.env @@ -1,4 +1,6 @@ -# VUE_APP_API_URL=http://31.129.106.67:8080 -# VUE_APP_GEO_URL=http://31.129.106.67:6001 -VUE_APP_API_URL=http://127.0.0.1:8080 -VUE_APP_GEO_URL=http://127.0.0.1:6001 \ No newline at end of file +VUE_APP_API_URL=http://31.129.106.67:8080 +VUE_APP_GEO_URL=http://31.129.106.67:6001 +VUE_APP_WEATHER_URL=http://31.129.106.67:6002 +# VUE_APP_API_URL=http://127.0.0.1:8080 +# VUE_APP_GEO_URL=http://127.0.0.1:6001 +# VUE_APP_WEATHER_URL=http://127.0.0.1:6002 \ No newline at end of file diff --git a/src/components/carrierinfo.vue b/src/components/carrierinfo.vue index 8afac48..74ad041 100644 --- a/src/components/carrierinfo.vue +++ b/src/components/carrierinfo.vue @@ -2,6 +2,593 @@
+ При поддержке Правительства
Санкт-Петербурга
import "../assets/style/main.css"; -import { API_URL } from "../config"; +import { API_URL, WEATHER_URL } from "../config"; import axios from "axios"; import clearIcon from "@/icons/clear-day.svg"; @@ -189,12 +189,9 @@ export default { async fetchWeatherData() { console.log("Fetching weather data..."); const now = new Date(); - const response = await axios.post( - "https://weather.wn.krbl.ru/v1/weather", - { - coordinates: { latitude: 59.938784, longitude: 30.314997 }, - } - ); + const response = await axios.post(`${WEATHER_URL}/v1/weather`, { + coordinates: { latitude: 59.938784, longitude: 30.314997 }, + }); this.currentWeather = { ...response.data.currentWeather, temperatureCelsius: Math.round( diff --git a/src/config.js b/src/config.js index 9b8087c..9675a6b 100644 --- a/src/config.js +++ b/src/config.js @@ -1,2 +1,3 @@ export const API_URL = process.env.VUE_APP_API_URL; export const GEO_URL = process.env.VUE_APP_GEO_URL; +export const WEATHER_URL = process.env.VUE_APP_WEATHER_URL;