refactor. 패키지 및 의존성 업데이트
- @pinia/nuxt 및 pinia 버전 업데이트 - app.vue에서 favicon 링크 생성 로직 개선 - error.vue에서 불필요한 console.log 제거 - pageData.global.ts에서 API URL 수정 및 에러 처리 로직 개선 - init-game-data.server.ts에서 언어 코드 설정 로직 개선 - gameData.ts에서 경로 필터링 로직 수정 - commonUtil.ts에서 정적 파일 확인 정규 표현식 개선
This commit is contained in:
@@ -3,18 +3,22 @@ import type { GameDataValue } from '#layers/types/api/gameData'
|
||||
export default defineNuxtPlugin({
|
||||
name: 'hydrate-game-data',
|
||||
dependsOn: ['pinia'],
|
||||
setup(_nuxtApp) {
|
||||
async setup(_nuxtApp) {
|
||||
if (!import.meta.server) return
|
||||
|
||||
const event = useRequestEvent()
|
||||
const gameData = (event?.context as { gameData?: GameDataValue })?.gameData
|
||||
const currentLangCode = (event?.context as { currentLangCode?: string })
|
||||
?.currentLangCode
|
||||
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.setCurrentLangCode(currentLangCode)
|
||||
gameDataStore.setGameData(gameData)
|
||||
gameDataStore.setCurrentLangCode(resolvedCurrentLangCode)
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user