31 lines
662 B
JavaScript
31 lines
662 B
JavaScript
/*
|
|
작성자 : 박지윤
|
|
작성일 : 2025-02-04
|
|
수정자 :
|
|
수정일 :
|
|
설명 : 로그인 한 사용자 정보
|
|
*/
|
|
|
|
import { ref } from 'vue';
|
|
import { defineStore } from 'pinia';
|
|
import $api from "@api";
|
|
|
|
export const useUserInfoStore = defineStore('userInfo', () => {
|
|
const user = ref(null);
|
|
|
|
// 사용자 정보 가져오기
|
|
const userInfo = async () => {
|
|
const response = await $api.get('user/userInfo');
|
|
if (response.data.status === "OK") {
|
|
user.value = response.data.data;
|
|
return true;
|
|
}
|
|
return false;
|
|
};
|
|
|
|
return {
|
|
user,
|
|
userInfo,
|
|
};
|
|
});
|