updated api url

This commit is contained in:
Warunee Tamkoo 2024-07-15 14:16:58 +07:00
parent f8d9b0ecc1
commit 9d77be0646
2 changed files with 66 additions and 55 deletions

3
.env
View file

@ -1,4 +1,5 @@
VITE_REALM_KEYCLOAK: "bma-ehr" VITE_REALM_KEYCLOAK: "bma-ehr"
VITE_CLIENTID_KEYCLOAK: "HRIS_ADMIN" 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.com/api/v1" VITE_API_URI_CONFIG: "https://bma-ehr.frappet.synology.me/api/v1"

View file

@ -1,8 +1,8 @@
/**config api */ /**config api */
import { ref } from "vue" import { ref } from "vue";
const env = ref<string>(process.env.NODE_ENV || "development") const env = ref<string>(process.env.NODE_ENV || "development");
export const apiUrlConfig = import.meta.env.VITE_API_URI_CONFIG export const apiUrlConfig = import.meta.env.VITE_API_URI_CONFIG;
// export const apiUrlConfigPublish = import.meta.env.VITE_API_PUBLISH_URL; // export const apiUrlConfigPublish = import.meta.env.VITE_API_PUBLISH_URL;
// export const apiUrlConfigReport = import.meta.env.VITE_API_REPORT_URL; // export const apiUrlConfigReport = import.meta.env.VITE_API_REPORT_URL;
// if (process.env.VUE_APP_TEST) { // if (process.env.VUE_APP_TEST) {
@ -10,57 +10,67 @@ export const apiUrlConfig = import.meta.env.VITE_API_URI_CONFIG
// } // }
const config = ref<any>({ const config = ref<any>({
development: { development: {
API_URI: apiUrlConfig, API_URI: apiUrlConfig,
API_URI_ORG_SERVICE: apiUrlConfig, //ใช้ชั่วคราว API_URI_ORG_SERVICE: apiUrlConfig, //ใช้ชั่วคราว
API_URI_ORG_EMPLOYEE_SERVICE: apiUrlConfig, //ใช้ชั่วคราว API_URI_ORG_EMPLOYEE_SERVICE: apiUrlConfig, //ใช้ชั่วคราว
API_URI_PROFILE_SERVICE: apiUrlConfig, API_URI_PROFILE_SERVICE: apiUrlConfig,
API_REPORT_URI: apiUrlConfig, API_REPORT_URI: apiUrlConfig,
MEET_URI: "meet.frappet.com", MEET_URI: "meet.frappet.com",
API_REPORT2_URI: "https://bma-ehr.frappet.synology.me/api/v2", API_REPORT2_URI: "https://bma-ehr.frappet.synology.me/api/v2",
API_REPORT_TEMPLATE_URI: "https://report-server.frappet.synology.me/api/v1/report-template", API_REPORT_TEMPLATE_URI:
API_LOG:"http://192.168.1.90:20007/api/v1" "https://report-server.frappet.synology.me/api/v1/report-template",
}, API_LOG: "http://192.168.1.90:20007/api/v1",
test: { },
API_URI: "http://localhost:5010/api/v1", test: {
API_CANDIDATE_URI: "https://localhost:7007/api/v1", API_URI: "http://localhost:5010/api/v1",
API_REPORT_URI: "https://localhost:7007/api/v1", API_CANDIDATE_URI: "https://localhost:7007/api/v1",
MEET_URI: "meet.frappet.com", API_REPORT_URI: "https://localhost:7007/api/v1",
}, MEET_URI: "meet.frappet.com",
production: { },
// API_URI: "https://localhost:5010", production: {
API_URI: apiUrlConfig, // API_URI: "https://localhost:5010",
API_URI_ORG_SERVICE: apiUrlConfig, //ใช้ชั่วคราว API_URI: apiUrlConfig,
API_URI_ORG_EMPLOYEE_SERVICE: apiUrlConfig, //ใช้ชั่วคราว API_URI_ORG_SERVICE: apiUrlConfig, //ใช้ชั่วคราว
API_URI_PROFILE_SERVICE: apiUrlConfig, API_URI_ORG_EMPLOYEE_SERVICE: apiUrlConfig, //ใช้ชั่วคราว
API_REPORT_URI: apiUrlConfig, API_URI_PROFILE_SERVICE: apiUrlConfig,
MEET_URI: "meet.frappet.com", API_REPORT_URI: apiUrlConfig,
API_REPORT2_URI: `${window.location.protocol}//${window.location.host}/api/v2`, MEET_URI: "meet.frappet.com",
API_REPORT_TEMPLATE_URI: "https://report-server.frappet.synology.me/api/v1/report-template", API_REPORT2_URI: `${window.location.protocol}//${window.location.host}/api/v2`,
API_LOG:"https://bma-ehr-admin.frappet.synology.me/api/v1" API_REPORT_TEMPLATE_URI:
}, "https://report-server.frappet.synology.me/api/v1/report-template",
}) API_LOG: apiUrlConfig,
},
});
const API_URI = ref<string>(config.value[env.value].API_URI) const API_URI = ref<string>(config.value[env.value].API_URI);
const API_REPORT_URI = ref<string>(config.value[env.value].API_REPORT_URI) const API_REPORT_URI = ref<string>(config.value[env.value].API_REPORT_URI);
const API_URI_ORG_SERVICE = ref<string>(config.value[env.value].API_URI_ORG_SERVICE) const API_URI_ORG_SERVICE = ref<string>(
const API_URI_ORG_EMPLOYEE_SERVICE = ref<string>(config.value[env.value].API_URI_ORG_EMPLOYEE_SERVICE) config.value[env.value].API_URI_ORG_SERVICE
const MEET_URI = ref<string>(config.value[env.value].MEET_URI) );
const API_URI_PROFILE_SERVICE = ref<string>(config.value[env.value].API_URI_PROFILE_SERVICE) const API_URI_ORG_EMPLOYEE_SERVICE = ref<string>(
const API_REPORT2_URI = ref<string>(config.value[env.value].API_REPORT2_URI) config.value[env.value].API_URI_ORG_EMPLOYEE_SERVICE
const API_REPORT_TEMPLATE_URI = ref<string>(config.value[env.value].API_REPORT_TEMPLATE_URI) );
const API_LOG = ref<string>(config.value[env.value].API_LOG) const MEET_URI = ref<string>(config.value[env.value].MEET_URI);
const API_URI_PROFILE_SERVICE = ref<string>(
config.value[env.value].API_URI_PROFILE_SERVICE
);
const API_REPORT2_URI = ref<string>(config.value[env.value].API_REPORT2_URI);
const API_REPORT_TEMPLATE_URI = ref<string>(
config.value[env.value].API_REPORT_TEMPLATE_URI
);
const API_LOG = ref<string>(config.value[env.value].API_LOG);
export default { export default {
env: env.value, env: env.value,
config: config.value, config: config.value,
API_URI: API_URI.value, API_URI: API_URI.value,
API_REPORT_URI: API_REPORT_URI.value, API_REPORT_URI: API_REPORT_URI.value,
API_URI_ORG_SERVICE: API_URI_ORG_SERVICE.value, API_URI_ORG_SERVICE: API_URI_ORG_SERVICE.value,
API_URI_ORG_EMPLOYEE_SERVICE: API_URI_ORG_EMPLOYEE_SERVICE.value, API_URI_ORG_EMPLOYEE_SERVICE: API_URI_ORG_EMPLOYEE_SERVICE.value,
API_URI_PROFILE_SERVICE: API_URI_PROFILE_SERVICE.value, API_URI_PROFILE_SERVICE: API_URI_PROFILE_SERVICE.value,
MEET_URI: MEET_URI.value, MEET_URI: MEET_URI.value,
API_REPORT2_URI: API_REPORT2_URI.value, API_REPORT2_URI: API_REPORT2_URI.value,
API_REPORT_TEMPLATE_URI: API_REPORT_TEMPLATE_URI.value, API_REPORT_TEMPLATE_URI: API_REPORT_TEMPLATE_URI.value,
API_LOG:API_LOG.value API_LOG: API_LOG.value,
} };