From 7c1f4502ec3b25176824a04e93f51ada205e1c67 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Wed, 18 Dec 2024 12:02:38 +0700 Subject: [PATCH] updated api config --- .env.production | 5 +++-- src/api/index.ts | 24 +++++++++++++----------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.env.production b/.env.production index a12fa7224..152411c46 100644 --- a/.env.production +++ b/.env.production @@ -3,5 +3,6 @@ VITE_QUALIFY_DISABLE_EMAM_PANEL=VITE_QUALIFY_DISABLE_EMAM_PANEL VITE_QUALIFY_EXAM_PANEL=VITE_QUALIFY_EXAM_PANEL VITE_API_PUBLISH_URL=VITE_API_PUBLISH_URL VITE_API_REPORT_URL=VITE_API_REPORT_URL -VITE_MANUAL_URL: VITE_MANUAL_URL -VITE_URL_SSO: VITE_URL_SSO \ No newline at end of file +VITE_MANUAL_URL=VITE_MANUAL_URL +VITE_URL_SSO=VITE_URL_SSO +VITE_API_URI_CONFIG=VITE_API_URI_CONFIG \ No newline at end of file diff --git a/src/api/index.ts b/src/api/index.ts index b29b5fb3d..b75046d0f 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -2,8 +2,10 @@ import { ref } from "vue"; const env = ref(process.env.NODE_ENV || "development"); +export const apiUrlConfig = import.meta.env.VITE_API_URI_CONFIG; export const apiUrlConfigPublish = import.meta.env.VITE_API_PUBLISH_URL; export const apiUrlConfigReport = import.meta.env.VITE_API_REPORT_URL; +export const apiUrlConfigReport2 = import.meta.env.VITE_API_URI_REPORT_CONFIG; // if (process.env.VUE_APP_TEST) { // env = "test"; // } @@ -45,22 +47,22 @@ const config = ref({ }, production: { // API_URI: "https://localhost:5010", - API_URI: `${window.location.protocol}//${window.location.host}/api/v1`, - API_URI_ORG_SERVICE: `${window.location.protocol}//${window.location.host}/api/v1`, //ใช้ชั่วคราว - API_URI_ORG_EMPLOYEE_SERVICE: `${window.location.protocol}//${window.location.host}/api/v1`, //ใช้ชั่วคราว - API_URI_PROFILE_SERVICE: `${window.location.protocol}//${window.location.host}/api/v1`, - API_CANDIDATE_URI: `${window.location.protocol}//${window.location.host}/api/v1`, - API_REPORT_URI: `${window.location.protocol}//${window.location.host}/api/v1`, - API_PLACEMENT_URI: `${window.location.protocol}//${window.location.host}/api/v1`, + API_URI: apiUrlConfig, + API_URI_ORG_SERVICE: apiUrlConfig, //ใช้ชั่วคราว + API_URI_ORG_EMPLOYEE_SERVICE: apiUrlConfig, //ใช้ชั่วคราว + API_URI_PROFILE_SERVICE: apiUrlConfig, + API_CANDIDATE_URI: apiUrlConfig, + API_REPORT_URI: apiUrlConfig, + API_PLACEMENT_URI: apiUrlConfig, API_URI_ORG_TREE: "https://s3cluster.frappet.com/bma-ehr-fpt/organization/strueture/tree_20230707_115124.json", MEET_URI: "meet.frappet.com", - API_RETIREMENT_URI: `${window.location.protocol}//${window.location.host}/api/v1`, - API_PROBATION_URI: `${window.location.protocol}//${window.location.host}/api/v1/probation`, - API_REPORT2_URI: `${window.location.protocol}//${window.location.host}/api/v2`, + API_RETIREMENT_URI: apiUrlConfig, + API_PROBATION_URI: `${apiUrlConfig}/probation`, + API_REPORT2_URI: `${apiUrlConfigReport2}`, LINK_EVALUATE_PUBLISH: apiUrlConfigPublish, API_REPORT_TEMPLATE_URI: apiUrlConfigReport, - API_SUPPORT_URI: `${window.location.protocol}//${window.location.host}/api/v1/support`, + API_SUPPORT_URI: `${apiUrlConfigPublish}/support`, }, });