유저 승인 api 변경
All checks were successful
LocalNet_front/pipeline/head This commit looks good

This commit is contained in:
nevermoregb 2025-04-10 13:42:32 +09:00
parent ba9a752250
commit 803e6da4b3

View File

@ -21,18 +21,18 @@
import MainVote from '@c/main/MainVote.vue'; import MainVote from '@c/main/MainVote.vue';
import { useUserInfoStore } from '@/stores/useUserInfoStore'; import { useUserInfoStore } from '@/stores/useUserInfoStore';
import { onMounted, ref } from 'vue'; import { onMounted, ref } from 'vue';
import $api from '@api';
const userStore = useUserInfoStore(); const userStore = useUserInfoStore();
const user = ref();
const isAdmin = ref(false); const isAdmin = ref(false);
const checkAdmin = user => { const checkAdmin = async user => {
return user?.value?.role === 'ROLE_ADMIN' ? true : false; const { data } = await $api.post('user/authCheck', { memberId: user.loginId });
return data.data === 'ROLE_ADMIN' ? true : false;
}; };
onMounted(async () => { onMounted(async () => {
await userStore.userInfo(); await userStore.userInfo();
user.value = userStore.user; isAdmin.value = await checkAdmin(userStore.user);
isAdmin.value = await checkAdmin(user);
}); });
</script> </script>