remove keycloak use cookie auth
This commit is contained in:
parent
035db71697
commit
5a5e37c12d
27 changed files with 501 additions and 440 deletions
|
|
@ -1,12 +1,12 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, onUnmounted, watch } from "vue";
|
||||
import keycloak, { kcLogout } from "@/plugins/keycloak";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { scroll, useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useMenuDataStore } from "@/stores/menuList";
|
||||
import { tokenParsed, logout } from "@/plugins/auth";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
|
@ -231,8 +231,12 @@ onMounted(async () => {
|
|||
await fetchSys();
|
||||
await fetchPermissionsSys();
|
||||
|
||||
if (keycloak.tokenParsed) {
|
||||
await fetchroleUser(keycloak.tokenParsed.role);
|
||||
const user = await tokenParsed();
|
||||
if (user) {
|
||||
fullname.value = user.name;
|
||||
role.value = user.role;
|
||||
|
||||
await fetchroleUser(user.role);
|
||||
}
|
||||
await fetchmsgNoread();
|
||||
|
||||
|
|
@ -405,28 +409,20 @@ const tagClickPlacement = (tag: string) => {
|
|||
//**** End Tab Right หน้าจอแก้ไขข้อมูลส่วนตัวของผู้สอบผ่าน ****\\
|
||||
|
||||
/**
|
||||
* logout keycloak
|
||||
* logout
|
||||
* confirm ก่อนออกจากระบบ
|
||||
*/
|
||||
const doLogout = () => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
kcLogout();
|
||||
logout();
|
||||
},
|
||||
"ยืนยันการออกจากระบบ",
|
||||
"ต้องการออกจากระบบใช่หรือไม่?"
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* ดิงชื่อผู้ใช้งานจาก keycloak
|
||||
*/
|
||||
if (keycloak.tokenParsed != null) {
|
||||
fullname.value = keycloak.tokenParsed.name;
|
||||
role.value = keycloak.tokenParsed.role;
|
||||
}
|
||||
|
||||
const clickDelete = async (id: string, index: number) => {
|
||||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue