From 13a02a7f04a0eb2a345197fef4b0cd0786dfaffe Mon Sep 17 00:00:00 2001 From: Kittapath Date: Sun, 24 Dec 2023 02:02:34 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20env?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.production | 4 +++- entrypoint.sh | 3 ++- src/api/index.ts | 4 +++- src/modules/06_evaluate/components/step/step2.vue | 3 ++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.env.production b/.env.production index 8d73df3..cc786da 100644 --- a/.env.production +++ b/.env.production @@ -2,8 +2,10 @@ VITE_REALM_KEYCLOAK=VITE_REALM_KEYCLOAK VITE_CLIENTID_KEYCLOAK=VITE_CLIENTID_KEYCLOAK VITE_URL_KEYCLOAK=VITE_URL_KEYCLOAK VITE_API_URI_CONFIG=VITE_API_URI_CONFIG +VITE_API_PUBLISH_URL=VITE_API_PUBLISH_URL # VITE_REALM_KEYCLOAK: "bma-ehr" # VITE_CLIENTID_KEYCLOAK: "bma-ehr-exam-vue3" # 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 +# VITE_API_URI_CONFIG: "https://bma-ehr.frappet.synology.me/api/v1" +# VITE_API_PUBLISH_URL: "https://bma-ehr-publish.frappet.synology.me" \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 4c56a83..6c61c00 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,7 +4,7 @@ ROOT_DIR=/app # Replace env vars in JavaScript files echo "Replacing env constants in JS" -for file in $ROOT_DIR/assets/app.*.js* $ROOT_DIR/js/app.*.js* $ROOT_DIR/assets/QSpace-*.js* $ROOT_DIR/index.html $ROOT_DIR/precache-manifest*.js $ROOT_DIR/assets/index*.js*; +for file in $ROOT_DIR/assets/app.*.js* $ROOT_DIR/js/app.*.js* $ROOT_DIR/assets/QSpace-*.js* $ROOT_DIR/index.html $ROOT_DIR/precache-manifest*.js $ROOT_DIR/assets/index*.js* $ROOT_DIR/assets/*.js*; do echo "Processing $file ..."; @@ -12,6 +12,7 @@ do sed -i 's|VITE_CLIENTID_KEYCLOAK|'${VITE_CLIENTID_KEYCLOAK}'|g' $file sed -i 's|VITE_URL_KEYCLOAK|'${VITE_URL_KEYCLOAK}'|g' $file sed -i 's|VITE_API_URI_CONFIG|'${VITE_API_URI_CONFIG}'|g' $file + sed -i 's|VITE_API_PUBLISH_URL|'${VITE_API_PUBLISH_URL}'|g' $file done diff --git a/src/api/index.ts b/src/api/index.ts index bf67241..bf75ba8 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -3,6 +3,8 @@ 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; + // if (process.env.VUE_APP_TEST) { // env = "test"; // } @@ -22,7 +24,7 @@ const config = ref({ API_URI_ORG_TREE: "https://s3cluster.frappet.com/bma-ehr-fpt/organization/strueture/tree_20230707_115124.json", MEET_URI: "meet.frappet.com", - LINK_EVALUATE_PUBLISH: `${window.location.protocol}//${window.location.host}`, + LINK_EVALUATE_PUBLISH: apiUrlConfigPublish, }, }); diff --git a/src/modules/06_evaluate/components/step/step2.vue b/src/modules/06_evaluate/components/step/step2.vue index f40071b..e752aba 100644 --- a/src/modules/06_evaluate/components/step/step2.vue +++ b/src/modules/06_evaluate/components/step/step2.vue @@ -196,10 +196,10 @@ async function fetcheSigner(id: string) { .finally(() => { hideLoader(); }); - fetchCheckSpec(id); } async function fetchCheckSpec(id: string) { + console.log("zxczx") showLoader(); await http .get(config.API.evaluationCheckspecByid(id)) @@ -267,6 +267,7 @@ onMounted(async () => { if (store.currentStep > 2) { fetcheSigner(store.evaluateId); } + fetchCheckSpec(store.evaluateId ); emit("update:form", formCommand, ref); downloadFile("1-แบบพิจารณาคุณสมบัติบุคคล"); downloadFile("2-แบบแสดงรายละเอียดการเสนอผลงาน");