From 9ee69e6730153e45fc694af4f22bd44b8b1a35de Mon Sep 17 00:00:00 2001 From: yoon Date: Tue, 4 Feb 2025 14:22:49 +0900 Subject: [PATCH] api --- src/stores/useAuthStore.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/stores/useAuthStore.js b/src/stores/useAuthStore.js index b944993..d0c84b8 100644 --- a/src/stores/useAuthStore.js +++ b/src/stores/useAuthStore.js @@ -1,6 +1,13 @@ +/* + 작성자 : 박지윤 + 작성일 : 2025-02-04 + 수정자 : + 수정일 : + 설명 : 로그인 상태, 로그아웃 +*/ import { ref, computed } from 'vue'; import { defineStore } from 'pinia'; -import axios from "@api"; +import $api from "@api"; export const useAuthStore = defineStore('auth', () => { const user = ref(null); @@ -10,7 +17,7 @@ export const useAuthStore = defineStore('auth', () => { // 로그인 상태 확인 const checkAuthStatus = async () => { - const response = await axios.get('user/isLogin'); + const response = await $api.get('user/isLogin'); if (response.data.status === "OK" && response.data.data) { user.value = response.data.data; } else { @@ -21,7 +28,7 @@ export const useAuthStore = defineStore('auth', () => { // 로그아웃 const logout = async () => { - const response = await axios.get('user/logout'); + const response = await $api.get('user/logout'); // 로그아웃 성공 시 사용자 상태 초기화 if (response.data.status === "OK") {