2026-07-11 07:50:47 +09:00
|
|
|
import { createApp } from 'vue'
|
|
|
|
|
import { Quasar, Notify } from 'quasar'
|
|
|
|
|
import { createPinia } from 'pinia'
|
|
|
|
|
|
|
|
|
|
// Quasar 필수 스타일 & 아이콘
|
|
|
|
|
import '@quasar/extras/material-icons/material-icons.css'
|
|
|
|
|
import '@quasar/extras/mdi-v7/mdi-v7.css'
|
|
|
|
|
import 'quasar/src/css/index.sass'
|
|
|
|
|
|
|
|
|
|
import App from './App.vue'
|
|
|
|
|
import router from './router'
|
|
|
|
|
import './css/app.scss'
|
2026-07-11 08:35:00 +09:00
|
|
|
import { setUnauthorizedHandler } from '@/api/http'
|
|
|
|
|
import { useAuthStore } from '@/stores/auth'
|
2026-07-11 07:50:47 +09:00
|
|
|
|
|
|
|
|
const app = createApp(App)
|
|
|
|
|
|
2026-07-11 08:35:00 +09:00
|
|
|
const pinia = createPinia()
|
|
|
|
|
app.use(pinia)
|
2026-07-11 07:50:47 +09:00
|
|
|
app.use(Quasar, {
|
|
|
|
|
plugins: { Notify },
|
|
|
|
|
config: {
|
2026-07-11 08:35:00 +09:00
|
|
|
brand: { primary: '#6DB3E8' },
|
2026-07-11 07:50:47 +09:00
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
app.use(router)
|
|
|
|
|
|
2026-07-11 08:35:00 +09:00
|
|
|
// 401 응답 시 로그인 화면으로
|
|
|
|
|
setUnauthorizedHandler(() => {
|
|
|
|
|
if (router.currentRoute.value.name !== 'login') {
|
|
|
|
|
router.replace({ name: 'login' })
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 저장된 토큰으로 세션 복구 후 마운트 (라우터 가드가 올바른 상태를 보도록)
|
|
|
|
|
const auth = useAuthStore(pinia)
|
|
|
|
|
auth.init().finally(() => app.mount('#app'))
|