remove keycloak use cookie auth
This commit is contained in:
parent
035db71697
commit
5a5e37c12d
27 changed files with 501 additions and 440 deletions
|
|
@ -11,7 +11,6 @@ import allLocales from "@fullcalendar/core/locales-all";
|
|||
import listPlugin from "@fullcalendar/list";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
import moment from "moment";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
/** importType*/
|
||||
|
|
@ -19,6 +18,7 @@ import type {
|
|||
DataDateMonthObject,
|
||||
ResCalendar,
|
||||
} from "@/modules/09_leave/interface/response/leave";
|
||||
import { tokenParsed } from "@/plugins/auth";
|
||||
|
||||
/** importStore*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
|
@ -32,9 +32,7 @@ const router = useRouter();
|
|||
|
||||
const { showLoader, hideLoader, messageError, monthYear2Thai } = mixin;
|
||||
|
||||
const keycloakId = ref<string>(
|
||||
keycloak.tokenParsed ? keycloak.tokenParsed.sub!.toString() : ""
|
||||
);
|
||||
const keycloakId = ref<string>("");
|
||||
/**
|
||||
* Option ของปฏิทิน
|
||||
*/
|
||||
|
|
@ -209,6 +207,8 @@ function redirectToDetail(id: string) {
|
|||
* เรียกฟังก์ชันทั้งหมดตอนเรียกใช้ไฟล์นี้
|
||||
*/
|
||||
onMounted(async () => {
|
||||
const user = await tokenParsed();
|
||||
keycloakId.value = user?.sub;
|
||||
await fetchDataCalendar("onMounted");
|
||||
});
|
||||
|
||||
|
|
@ -292,11 +292,19 @@ const monthYearThai = (val: DataDateMonthObject) => {
|
|||
<template v-slot:eventContent="arg">
|
||||
<div
|
||||
class="row col-12 items-center no-wrap"
|
||||
:style="checkPermission($route)?.attrIsGet ? `background: + ${arg.event.color}`:`background: + ${arg.event.color};pointer-events: none;cursor: auto;`"
|
||||
:style="
|
||||
checkPermission($route)?.attrIsGet
|
||||
? `background: + ${arg.event.color}`
|
||||
: `background: + ${arg.event.color};pointer-events: none;cursor: auto;`
|
||||
"
|
||||
>
|
||||
<div
|
||||
class="textHover col-10"
|
||||
@click="checkPermission($route)?.attrIsGet ? redirectToDetail(arg.event.id):''"
|
||||
@click="
|
||||
checkPermission($route)?.attrIsGet
|
||||
? redirectToDetail(arg.event.id)
|
||||
: ''
|
||||
"
|
||||
>
|
||||
{{ arg.event.title }}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue