diff --git a/src/api/org/api.org.ts b/src/api/org/api.org.ts index e3f8c51..0d025f4 100644 --- a/src/api/org/api.org.ts +++ b/src/api/org/api.org.ts @@ -28,9 +28,11 @@ export default { dataUserAbilityByType: (type: string) => `${org}/profile${type}/ability/user`, dataUserGovernment: `${profileOrg}/government/user`, - dataUserGovernmentByType: (type: string) => `${org}/profile${type}/government/user`, + dataUserGovernmentByType: (type: string) => + `${org}/profile${type}/government/user`, dataUserDiscipline: `${profileOrg}/discipline/user`, - dataUserDisciplineByType: (type: string) => `${org}/profile${type}/discipline/user`, + dataUserDisciplineByType: (type: string) => + `${org}/profile${type}/discipline/user`, dataUserLeave: `${profileOrg}/leave/user`, dataUserLeaveByType: (type: string) => `${org}/profile${type}/leave/user`, dataUserDuty: `${profileOrg}/duty/user`, @@ -43,7 +45,8 @@ export default { dataUserNopaidByType: (type: string) => `${org}/profile${type}/nopaid/user`, dataUserCertificate: (type: string) => `${profileOrg}/${type}/user`, - dataUserCertificateByType: (emType:string,type: string) => `${org}/profile${emType}/${type}/user`, + dataUserCertificateByType: (emType: string, type: string) => + `${org}/profile${emType}/${type}/user`, dataUserOther: `${profileOrg}/other/user`, dataUserOtherByType: (type: string) => `${org}/profile${type}/other/user`, @@ -73,25 +76,35 @@ export default { `${profileOrg}${type}/government/history/user`, dataUserDisciplineHistory: (id: string) => `${profileOrg}/discipline/history/${id}`, - dataUserDisciplineHistoryByType: (emType:string,id: string) => `${org}/profile${emType}/discipline/history/${id}`, + dataUserDisciplineHistoryByType: (emType: string, id: string) => + `${org}/profile${emType}/discipline/history/${id}`, dataUserLeaveHistory: (id: string) => `${profileOrg}/leave/history/${id}`, - dataUserLeaveHistoryByType: (emType:string,id: string) => `${org}/profile${emType}/leave/history/${id}`, + dataUserLeaveHistoryByType: (emType: string, id: string) => + `${org}/profile${emType}/leave/history/${id}`, dataUserDutyHistory: (id: string) => `${profileOrg}/duty/history/${id}`, - dataUserDutyHistoryByType: (emType:string,id: string) => `${org}/profile${emType}/duty/history/${id}`, + dataUserDutyHistoryByType: (emType: string, id: string) => + `${org}/profile${emType}/duty/history/${id}`, dataUserSalaryHistory: (id: string) => `${profileOrg}/salary/history/${id}`, - dataUserSalaryHistoryByType: (emType:string,id: string) => `${org}/profile${emType}/salary/history/${id}`, + dataUserSalaryHistoryByType: (emType: string, id: string) => + `${org}/profile${emType}/salary/history/${id}`, dataUserSalaryNopaidHistory: (id: string) => `${profileOrg}/nopaid/history/${id}`, - dataUserSalaryNopaidHistoryByType: (emType:string,id: string) => `${org}/profile${emType}/nopaid/history/${id}`, + dataUserSalaryNopaidHistoryByType: (emType: string, id: string) => + `${org}/profile${emType}/nopaid/history/${id}`, dataUserCertificateHistory: (type: string, id: string) => `${profileOrg}/${type}/history/${id}`, - dataUserCertificateHistoryByType: (emType:string,type:string,id: string) => `${org}/profile${emType}/${type}/history/${id}`, + dataUserCertificateHistoryByType: ( + emType: string, + type: string, + id: string + ) => `${org}/profile${emType}/${type}/history/${id}`, dataUserHonorHistory: (type: string, emType: string, id: string) => `${profileOrg}${emType}/${type}/history/${id}`, dataUserOtherHistory: (id: string) => `${profileOrg}/other/history/${id}`, - dataUserOtherHistoryByType: (emType:string,id: string) => `${org}/profile${emType}/other/history/${id}`, + dataUserOtherHistoryByType: (emType: string, id: string) => + `${org}/profile${emType}/other/history/${id}`, orgCheckAvatar: (id: string) => `${profileOrg}/avatar/profileId/${id}`, orgSearchCommander: () => `${profileOrg}/search/commander`, @@ -112,18 +125,22 @@ export default { * รายการคำร้องขอแก้ไขข้อมูลทะเบียนประวัติ */ requestEdit: `${profileOrg}/edit/`, - requestEditByType:(type:string)=> `${org}/profile${type}/edit/`, + requestEditByType: (type: string) => `${org}/profile${type}/edit/`, requestsEdit: `${profileOrg}/edit`, - requestsEditByType:(type:string)=> `${org}/profile${type}/edit`, + requestsEditByType: (type: string) => `${org}/profile${type}/edit`, developmentUser: `${profileOrg}/development/user`, - developmentUserByType: (type: string) => `${org}/profile${type}/development/user`, + developmentUserByType: (type: string) => + `${org}/profile${type}/development/user`, upDateNumber: `${profileOrg}/updatePhoneNumber/user`, - upDateNumberByType: (type: string) => `${org}/profile${type}/updatePhoneNumber/user`, + upDateNumberByType: (type: string) => + `${org}/profile${type}/updatePhoneNumber/user`, updateEmail: `${profileOrg}/updateEmail/user`, updateEmailByType: (type: string) => `${org}/profile${type}/updateEmail/user`, /** * workflow */ workflow: `${workflow}/`, + + keycloakLogSSO: `${org}/keycloak/log/sso`, }; diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index d368a44..c9c465e 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -46,7 +46,7 @@ onMounted(async () => { }); async function checkUser() { - await http + await http .get(config.API.profilePosition()) .then(async (res) => { const data = await res.data.result; @@ -55,7 +55,6 @@ async function checkUser() { if (data.avatarName) { await getImg(data.profileId, data.avatarName); } else { - dataStore.profileImg = avatar; } }) @@ -145,8 +144,9 @@ const doLogout = () => { dialogConfirm( $q, async () => { + await http.post(config.API.keycloakLogSSO, { text: "ออกจากระบบ" }); // authen with client - logout(); + await logout(); }, "ยืนยันการออกจากระบบ", "ต้องการออกจากระบบใช่หรือไม่" diff --git a/vite.config.ts b/vite.config.ts index f360373..36db0bc 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -27,5 +27,4 @@ export default defineConfig({ server: { port: 3007, }, - base: "./", });