stroes roleUser ,แก้ไขคำผิด
This commit is contained in:
parent
6985318f13
commit
7c60c42cb0
3 changed files with 53 additions and 6 deletions
41
src/stores/roleUser.ts
Normal file
41
src/stores/roleUser.ts
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
|
||||
export const useroleUserDataStore = defineStore("roleusers", () => {
|
||||
const insignia1Role = ref<boolean>(false)
|
||||
const insignia2Role = ref<boolean>(false)
|
||||
const caregiverRole = ref<boolean>(false)
|
||||
const chairmanRole = ref<boolean>(false)
|
||||
const commanderRole = ref<boolean>(false)
|
||||
const admin2Role = ref<boolean>(false)
|
||||
const adminRole = ref<boolean>(false)
|
||||
const oligarchRole = ref<boolean>(false)
|
||||
|
||||
|
||||
|
||||
|
||||
const fetchroleUser = async (keycloak: any) => {
|
||||
// console.log(keycloak);
|
||||
if (keycloak != null) {
|
||||
insignia1Role.value = await keycloak.includes("insignia1");
|
||||
insignia2Role.value = await keycloak.includes("insignia2");
|
||||
caregiverRole.value = await keycloak.includes("caregiver");
|
||||
chairmanRole.value = await keycloak.includes("chairman");
|
||||
commanderRole.value = await keycloak.includes("commander");
|
||||
admin2Role.value = await keycloak.includes("admin2");
|
||||
adminRole.value = await keycloak.includes("admin");
|
||||
oligarchRole.value = await keycloak.includes("oligarch");
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
fetchroleUser,
|
||||
insignia1Role,
|
||||
insignia2Role,
|
||||
caregiverRole,
|
||||
chairmanRole,
|
||||
commanderRole,
|
||||
admin2Role,
|
||||
adminRole,
|
||||
};
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue