fixed image profile to store
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m30s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m30s
This commit is contained in:
parent
005cdbd95b
commit
001e7d3580
2 changed files with 19 additions and 10 deletions
|
|
@ -11,16 +11,26 @@ export const usePositionKeycloakStore = defineStore(
|
|||
'รายการลงเวลากรณีพิเศษ',
|
||||
])
|
||||
const dataPositionKeycloak = ref<KeycloakPosition | null>(null)
|
||||
const profileImg = ref<string>('')
|
||||
|
||||
function setPositionKeycloak(data: KeycloakPosition) {
|
||||
dataPositionKeycloak.value = data
|
||||
}
|
||||
|
||||
/**
|
||||
* ตั้งค่ารูปโปรไฟล์ผู้ใช้งาน
|
||||
* @param url URL ของรูปโปรไฟล์
|
||||
*/
|
||||
function setProfileImg(url: string) {
|
||||
profileImg.value = url
|
||||
}
|
||||
|
||||
/**
|
||||
* ล้างข้อมูล Keycloak position (ใช้เมื่อ logout)
|
||||
*/
|
||||
function clearPositionKeycloak() {
|
||||
dataPositionKeycloak.value = null
|
||||
profileImg.value = ''
|
||||
// ลบ localStorage ด้วยเพื่อให้แน่ใจว่าข้อมูลหายจริง
|
||||
localStorage.removeItem('positionKeycloak')
|
||||
}
|
||||
|
|
@ -52,7 +62,9 @@ export const usePositionKeycloakStore = defineStore(
|
|||
return {
|
||||
setPositionKeycloak,
|
||||
clearPositionKeycloak,
|
||||
setProfileImg,
|
||||
dataPositionKeycloak,
|
||||
profileImg,
|
||||
findOrgName,
|
||||
menuData,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue