From 00397f5e570b60a20ad30da558706ba2a383a7d1 Mon Sep 17 00:00:00 2001 From: puri-ph4tt Date: Tue, 6 Feb 2024 10:03:45 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84=E0=B8=82?= =?UTF-8?q?=20api=20socket=20(support)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.ts | 8 +++++++- src/api/support/api.support.ts | 2 ++ src/modules/00_support/store/Main.ts | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index e900cfb..bd53cbe 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -13,6 +13,7 @@ const config = ref({ // API_URI: "https://localhost:7260/api", API_URI: "https://bma-ehr.frappet.synology.me/api/v1", API_URL_SUPPORT: "http://192.168.1.10:3000/api/v1/support", + API_SUPPORT_SOCKET: "http://192.168.1.10:3000/", MEET_URI: "meet.frappet.com", LINK_EVALUATE_PUBLISH: "https://bma-ehr-publish.frappet.synology.me", }, @@ -23,6 +24,7 @@ const config = ref({ production: { API_URI: apiUrlConfig, API_URL_SUPPORT: "http://192.168.1.10:3000/api/v1/support", + API_SUPPORT_SOCKET: "http://192.168.1.10:3000/", API_URI_ORG_TREE: "https://s3cluster.frappet.com/bma-ehr-fpt/organization/strueture/tree_20230707_115124.json", MEET_URI: "meet.frappet.com", @@ -31,7 +33,10 @@ const config = ref({ }); const API_URI = ref(config.value[env.value].API_URI); -const API_URL_SUPPORT = ref(config.value[env.value].API_URL_SUPPORT) +const API_URL_SUPPORT = ref(config.value[env.value].API_URL_SUPPORT); +const API_SUPPORT_SOCKET = ref( + config.value[env.value].API_SUPPORT_SOCKET +); const MEET_URI = ref(config.value[env.value].MEET_URI); const LINK_EVALUATE_PUBLISH = ref( config.value[env.value].LINK_EVALUATE_PUBLISH @@ -42,6 +47,7 @@ export default { config: config.value, API_URI: API_URI.value, API_URL_SUPPORT: API_URL_SUPPORT.value, + API_SUPPORT_SOCKET: API_SUPPORT_SOCKET.value, MEET_URI: MEET_URI.value, LINK_EVALUATE_PUBLISH: LINK_EVALUATE_PUBLISH.value, }; diff --git a/src/api/support/api.support.ts b/src/api/support/api.support.ts index a17161e..5e2e63d 100644 --- a/src/api/support/api.support.ts +++ b/src/api/support/api.support.ts @@ -1,6 +1,7 @@ import env from "../index"; const support = `${env.API_URL_SUPPORT}`; +const socket = `${env.API_SUPPORT_SOCKET}`; export default { supportMessageStatus: (id: string) => `${support}/issue/${id}/message-status`, @@ -21,4 +22,5 @@ export default { supportIssueCategory: `${support}/issue-category`, supportNewIssue: `${support}/issue`, + supportSocket: `${socket}`, }; diff --git a/src/modules/00_support/store/Main.ts b/src/modules/00_support/store/Main.ts index 57e8ed4..bcb94da 100644 --- a/src/modules/00_support/store/Main.ts +++ b/src/modules/00_support/store/Main.ts @@ -30,7 +30,7 @@ export const useSupportStore = defineStore("supportServiceStore", () => { const items = ref([{}, {}, {}, {}, {}, {}, {}]); const scrollContainer = ref(); - const socket = io("http://192.168.1.10:3000/", { + const socket = io(config.API.supportSocket, { auth: { token: keycloak.token }, autoConnect: false, });