2026-05-30 21:18:13 +09:00
|
|
|
import './assets/main.css'
|
|
|
|
|
|
|
|
|
|
import { createApp } from 'vue'
|
|
|
|
|
import { createPinia } from 'pinia'
|
|
|
|
|
|
|
|
|
|
import App from './App.vue'
|
|
|
|
|
import router from './router'
|
2026-05-31 19:13:12 +09:00
|
|
|
import { setupCapacitor } from './capacitor'
|
2026-06-01 22:10:23 +09:00
|
|
|
import { useAuthStore } from './stores/auth'
|
2026-06-24 21:57:50 +09:00
|
|
|
import { useDialog } from './composables/dialog'
|
|
|
|
|
|
|
|
|
|
// 네이티브 alert 를 인앱 다이얼로그로 대체 (PC 'sb_pt' 제목 제거 + 웹/APK 일관).
|
|
|
|
|
// confirm/prompt 는 동기 반환이라 오버라이드 불가 → 각 호출부에서 await dialog.confirm/prompt 사용.
|
|
|
|
|
const dialog = useDialog()
|
|
|
|
|
window.alert = (message) => {
|
|
|
|
|
dialog.alert(message == null ? '' : String(message))
|
|
|
|
|
}
|
2026-05-30 21:18:13 +09:00
|
|
|
|
|
|
|
|
const app = createApp(App)
|
|
|
|
|
|
|
|
|
|
app.use(createPinia())
|
|
|
|
|
app.use(router)
|
|
|
|
|
|
2026-06-01 22:10:23 +09:00
|
|
|
// 저장된 세션(자동 로그인)을 복원한 뒤 마운트 — 로그인 상태가 결정된 후 렌더
|
|
|
|
|
const auth = useAuthStore()
|
|
|
|
|
auth.restore().finally(() => {
|
|
|
|
|
app.mount('#app')
|
|
|
|
|
// 네이티브 앱(안드로이드)일 때만 동작 (웹은 no-op)
|
|
|
|
|
setupCapacitor(router)
|
|
|
|
|
})
|