fix. config -> runtimeConfig 명칭 통일
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
export default defineNuxtRouteMiddleware(async (to) => {
|
||||
export default defineNuxtRouteMiddleware(async to => {
|
||||
try {
|
||||
if (import.meta.client) {
|
||||
const gameDataStore = useGameDataStore()
|
||||
const { gameData } = storeToRefs(gameDataStore)
|
||||
console.log("🚀 ~ 00000 gameData:", gameData.value)
|
||||
console.log('🚀 ~ 00000 gameData:', gameData.value)
|
||||
|
||||
const config = useRuntimeConfig()
|
||||
// const baseDomain = `${config.public.baseDomain}`
|
||||
const stoveApiBaseUrl = config.public.stoveApiUrl
|
||||
const runtimeConfig = useRuntimeConfig()
|
||||
// const baseDomain = `${runtimeConfig.public.baseDomain}`
|
||||
const stoveApiBaseUrl = runtimeConfig.public.stoveApiUrl
|
||||
const stoveGameId = gameData.value.game_id
|
||||
// const stoveMaintenanceApiUrl = `${config.public.stoveMaintenanceApiUrl}`
|
||||
// const stoveMaintenanceApiUrl = `${runtimeConfig.public.stoveMaintenanceApiUrl}`
|
||||
|
||||
// const localeCookie = useCookie('LOCALE', {
|
||||
// domain: baseDomain
|
||||
@@ -19,9 +19,12 @@ export default defineNuxtRouteMiddleware(async (to) => {
|
||||
// localeCookie.value = finalLocale.toUpperCase()
|
||||
|
||||
// 웹 점검 -----
|
||||
const { isWebInspection, getInspectionDataExternal } = useGetInspectionDataExternal()
|
||||
await getInspectionDataExternal({ baseApiUrl: stoveApiBaseUrl, gameId: stoveGameId })
|
||||
|
||||
const { isWebInspection, getInspectionDataExternal } =
|
||||
useGetInspectionDataExternal()
|
||||
await getInspectionDataExternal({
|
||||
baseApiUrl: stoveApiBaseUrl,
|
||||
gameId: stoveGameId,
|
||||
})
|
||||
|
||||
// 게임 점검 -----
|
||||
// const { checkGameMaintenance } = useGetGameMaintenance()
|
||||
@@ -32,10 +35,17 @@ export default defineNuxtRouteMiddleware(async (to) => {
|
||||
// lang: `${finalLocale}`.toLowerCase()
|
||||
// })
|
||||
|
||||
if (isWebInspection.value && !to.path.includes('inspection') && !to.path.includes('api')) {
|
||||
if (
|
||||
isWebInspection.value &&
|
||||
!to.path.includes('inspection') &&
|
||||
!to.path.includes('api')
|
||||
) {
|
||||
// 점검 중인 경우
|
||||
return navigateTo(`/${finalLocale}/inspection`, { external: true })
|
||||
} else if (!isWebInspection.value && to.path?.indexOf('inspection') !== -1) {
|
||||
} else if (
|
||||
!isWebInspection.value &&
|
||||
to.path?.indexOf('inspection') !== -1
|
||||
) {
|
||||
// 점검이 종료된 후 점검 페이지 접근시 메인으로 리다이렉트
|
||||
return navigateTo(`/${finalLocale}`, { external: true })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user