- @pinia/nuxt 및 pinia 버전 업데이트 - app.vue에서 favicon 링크 생성 로직 개선 - error.vue에서 불필요한 console.log 제거 - pageData.global.ts에서 API URL 수정 및 에러 처리 로직 개선 - init-game-data.server.ts에서 언어 코드 설정 로직 개선 - gameData.ts에서 경로 필터링 로직 수정 - commonUtil.ts에서 정적 파일 확인 정규 표현식 개선
25 lines
666 B
TypeScript
25 lines
666 B
TypeScript
import type { GameDataValue } from '#layers/types/api/gameData'
|
|
|
|
export default defineNuxtPlugin({
|
|
name: 'hydrate-game-data',
|
|
dependsOn: ['pinia'],
|
|
async setup(_nuxtApp) {
|
|
if (!import.meta.server) return
|
|
|
|
const event = useRequestEvent()
|
|
const eventContext = event?.context as {
|
|
gameData?: GameDataValue
|
|
currentLangCode?: string
|
|
}
|
|
|
|
const gameData = eventContext?.gameData
|
|
const resolvedCurrentLangCode = eventContext?.currentLangCode || null
|
|
|
|
if (!gameData) return
|
|
|
|
const gameDataStore = useGameDataStore()
|
|
gameDataStore.setGameData(gameData)
|
|
gameDataStore.setCurrentLangCode(resolvedCurrentLangCode)
|
|
},
|
|
})
|