diff --git a/.env b/.env index a6347f86..e5369308 100644 --- a/.env +++ b/.env @@ -1,3 +1,4 @@ VITE_REALM_KEYCLOAK: "bma-ehr" VITE_CLIENTID_KEYCLOAK: "HRIS_ADMIN" -VITE_URL_KEYCLOAK: "https://id.frappet.synology.me/" \ No newline at end of file +VITE_URL_KEYCLOAK: "https://id.frappet.synology.me/" +VITE_API_URI_CONFIG: "https://bma-ehr.frappet.synology.me/api/v1" \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 57b20dee..f6a7f419 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -13,6 +13,7 @@ do sed -i 's|VITE_URL_KEYCLOAK|'${VITE_URL_KEYCLOAK}'|g' $file sed -i 's|VITE_API_PUBLISH_URL|'${VITE_API_PUBLISH_URL}'|g' $file sed -i 's|VITE_API_REPORT_URL|'${VITE_API_REPORT_URL}'|g' $file + sed -i 's|VITE_API_URI_CONFIG|'${VITE_API_URI_CONFIG}'|g' $file done diff --git a/src/api/index.ts b/src/api/index.ts index 478cc27a..c81bbb7f 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -2,6 +2,7 @@ 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; // if (process.env.VUE_APP_TEST) { @@ -27,11 +28,11 @@ 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_REPORT_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_REPORT_URI: apiUrlConfig, MEET_URI: "meet.frappet.com", API_REPORT2_URI: `${window.location.protocol}//${window.location.host}/api/v2`, // API_REPORT_TEMPLATE_URI: apiUrlConfigReport,