From 54bd567401bda1bf9421ed21279aa440c5f364d0 Mon Sep 17 00:00:00 2001 From: AnandaTon <125332905+anandaAiemvong@users.noreply.github.com> Date: Tue, 21 Mar 2023 16:31:45 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=20api=20=E0=B8=84=E0=B8=B3=E0=B8=99=E0=B8=B3=E0=B8=AB=E0=B8=99?= =?UTF-8?q?=E0=B9=89=E0=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Form/Profile/Information.vue | 24 +++++++++++++++++-- src/plugins/keycloak.ts | 10 ++++---- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/modules/01_exam/components/Form/Profile/Information.vue b/src/modules/01_exam/components/Form/Profile/Information.vue index 01c7a4f..1495c13 100644 --- a/src/modules/01_exam/components/Form/Profile/Information.vue +++ b/src/modules/01_exam/components/Form/Profile/Information.vue @@ -25,7 +25,7 @@ :outlined="edit" dense lazy-rules - v-model="informaData.prefixId" + v-model="prefix" emit-value map-options option-label="name" @@ -339,6 +339,9 @@ import type { file } from '@babel/types' const mixin = useCounterMixin() const { date2Thai, calAge } = mixin +const prefix = ref() + +const prefixOptions = ref([]) const edit = ref(false) const informaData = ref(defaultInformation) @@ -390,6 +393,7 @@ const emit = defineEmits(['update:statusEdit']) onMounted(() => { // fetchProvince() + fetchprefix() }) const saveData = async () => { @@ -431,7 +435,23 @@ const fetchProvince = async () => { // // loader.value = false; // }) } - +const fetchprefix = async () => { + // loader.value = true; + await http + .get(config.API.prefix) + .then((res) => { + const data = res.data.result + let option: DataOption[] = [] + data.map((r: DataOption) => { + option.push({ id: r.id.toString(), name: r.name.toString() }) + }) + prefixOptions.value = option + }) + .catch((e) => {}) + .finally(() => { + // loader.value = false; + }) +} const savePic = () => { disabledPic.value = false } diff --git a/src/plugins/keycloak.ts b/src/plugins/keycloak.ts index 7aeee92..2525d50 100644 --- a/src/plugins/keycloak.ts +++ b/src/plugins/keycloak.ts @@ -8,11 +8,13 @@ import Keycloak from 'keycloak-js' const initOptions = { // url: "https://keycloak.frappet.synology.me/auth/", - // realm: "bma-ehr", - // clientId: "bma-ehr-vue3", + // realm: "bma-ehr", + // clientId: "bma-ehr-vue3", url: 'https://identity.frappet.com/', - realm: 'exam_test', - clientId: 'exam_vue3' + // realm: 'exam_test', + // clientId: 'exam_vue3' + realm: 'bma-ehr', + clientId: 'bma-ehr-vue3' } //option keycloak ที่จะ connect const keycloak = Keycloak(initOptions)