เพิ่ม env

This commit is contained in:
Kittapath 2024-06-07 09:19:22 +07:00
parent 66eb2bebca
commit 69a3bd3811
3 changed files with 9 additions and 6 deletions

3
.env
View file

@ -1,3 +1,4 @@
VITE_REALM_KEYCLOAK: "bma-ehr"
VITE_CLIENTID_KEYCLOAK: "HRIS_ADMIN"
VITE_URL_KEYCLOAK: "https://id.frappet.synology.me/"
VITE_URL_KEYCLOAK: "https://id.frappet.synology.me/"
VITE_API_URI_CONFIG: "https://bma-ehr.frappet.synology.me/api/v1"

View file

@ -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

View file

@ -2,6 +2,7 @@
import { ref } from "vue"
const env = ref<string>(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<any>({
},
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,