remove keycloak use cookie auth
This commit is contained in:
parent
035db71697
commit
5a5e37c12d
27 changed files with 501 additions and 440 deletions
|
|
@ -5,7 +5,7 @@ import { useRoute, useRouter } from "vue-router";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
import { tokenParsed } from "@/plugins/auth";
|
||||
import { useDisciplineSuspendStore } from "@/modules/11_discipline/store/SuspendStore";
|
||||
|
||||
/**Import type */
|
||||
|
|
@ -16,7 +16,6 @@ import type { DataProfile } from "@/modules/05_placement/interface/index/Main";
|
|||
import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
|
||||
import CardProfile from "@/components/CardProfile.vue";
|
||||
|
||||
|
||||
const modalPersonal = ref<boolean>(false);
|
||||
const personId = ref<string>("");
|
||||
/** use */
|
||||
|
|
@ -24,7 +23,9 @@ const dataStore = useDisciplineSuspendStore();
|
|||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const checkRoutePermission = ref<boolean>(route.name == 'disciplineDetailSuspend')
|
||||
const checkRoutePermission = ref<boolean>(
|
||||
route.name == "disciplineDetailSuspend"
|
||||
);
|
||||
const mixin = useCounterMixin();
|
||||
const dataId = route.params.id.toString();
|
||||
const {
|
||||
|
|
@ -251,8 +252,9 @@ function changeFormDataDate() {
|
|||
|
||||
/** Hook */
|
||||
onMounted(async () => {
|
||||
if (keycloak.tokenParsed != null) {
|
||||
roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1");
|
||||
const user = await tokenParsed();
|
||||
if (user) {
|
||||
roleAdmin.value = await user.role.includes("placement1");
|
||||
}
|
||||
await getData();
|
||||
});
|
||||
|
|
@ -332,10 +334,20 @@ onMounted(async () => {
|
|||
<q-form greedy @submit.prevent @validation-success="saveData">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">
|
||||
{{ checkRoutePermission ? 'รายละเอียดข้อมูลบัญชีแนบท้าย':'แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย'}}
|
||||
{{
|
||||
checkRoutePermission
|
||||
? "รายละเอียดข้อมูลบัญชีแนบท้าย"
|
||||
: "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย"
|
||||
}}
|
||||
</div>
|
||||
<q-space />
|
||||
<div v-if="data.status !== 'DONE' && data.status !== 'REPORT'&& !checkRoutePermission">
|
||||
<div
|
||||
v-if="
|
||||
data.status !== 'DONE' &&
|
||||
data.status !== 'REPORT' &&
|
||||
!checkRoutePermission
|
||||
"
|
||||
>
|
||||
<div class="q-gutter-sm" v-if="!edit">
|
||||
<q-btn
|
||||
outline
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue