Merge branch 'feature/20251201-gil_qa' into feature/202501107-all
This commit is contained in:
@@ -52,6 +52,7 @@
|
||||
<span
|
||||
v-else
|
||||
v-dompurify-html="tm('org_Inspection_During_Maintenance')"
|
||||
class="block text-left"
|
||||
></span>
|
||||
</h3>
|
||||
<div class="button-group justify-center">
|
||||
@@ -138,16 +139,10 @@ import { globalDateFormat } from '@seed-next/date'
|
||||
import { useCheckGameStart } from '#layers/composables/useGameStart'
|
||||
|
||||
const config = useRuntimeConfig()
|
||||
const stoveApiUrl = config.public.stoveApiUrl as string
|
||||
|
||||
const dataResourcesUrl = config.public.dataResourcesUrl as string
|
||||
const multilingualFileName = 'STOVE_PUBTEMPLATE_homepage_brand_inspection.json'
|
||||
|
||||
// const isClient = import.meta.client
|
||||
|
||||
const inspectionStore = useInspectionStore()
|
||||
const { webInspectionData } = storeToRefs(inspectionStore)
|
||||
const gameDataStore = useGameDataStore()
|
||||
const { gameData } = storeToRefs(gameDataStore)
|
||||
|
||||
// Multilingual
|
||||
const resultGetMultilingual = await useGetMultilingual({
|
||||
baseApiUrl: dataResourcesUrl,
|
||||
@@ -159,6 +154,15 @@ const { tm, locale }: any = useI18n({
|
||||
messages: Object(resultGetMultilingual?.value?.multilingual),
|
||||
})
|
||||
|
||||
const loadingStore = useLoadingStore()
|
||||
const { webInspectionData, getInspectionDataExternal } = useGetInspectionDataExternal()
|
||||
const gameDataStore = useGameDataStore()
|
||||
const { gameData } = storeToRefs(gameDataStore)
|
||||
await getInspectionDataExternal({
|
||||
baseApiUrl: stoveApiUrl,
|
||||
gameId: gameData.value.game_id,
|
||||
})
|
||||
|
||||
// locale에 따라 뒤에 KST 또는 UTC 추가 ko, en, zh-tw, ja
|
||||
// ko: (KST)
|
||||
// en: (UTC)
|
||||
@@ -172,8 +176,11 @@ const getLocaleTimezone = (localeType: string, region) => {
|
||||
|
||||
const timezoneMap: Record<string, string> = {
|
||||
ko: 'KST',
|
||||
'zh-tw': '台灣時間',
|
||||
en: 'UTC',
|
||||
ja: 'JST',
|
||||
'zh-tw': '台灣時間',
|
||||
'zh-cn': 'CST',
|
||||
th: 'ICT',
|
||||
}
|
||||
const timezone = timezoneMap[currentLocale] || 'KST'
|
||||
const defaultRegion = currentLocale === 'ko' ? 'KR' : ''
|
||||
@@ -261,10 +268,14 @@ const handleGameStart = () => {
|
||||
validateLauncher()
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
loadingStore.stopFullLoading()
|
||||
})
|
||||
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['inspection'],
|
||||
layout: 'only-stove',
|
||||
showLoading: false,
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -56,8 +56,7 @@ export default defineNuxtRouteMiddleware(async (to, _from) => {
|
||||
// error 페이지는 API 호출하지 않음
|
||||
if (
|
||||
pageUrl === '/error' ||
|
||||
to.path.includes('/error') ||
|
||||
to.path.includes('/inspection')
|
||||
to.path.includes('/error')
|
||||
) {
|
||||
console.log('🚀 ~ init.route.global error 페이지는 API 호출하지 않음')
|
||||
showError(
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
export default defineNuxtRouteMiddleware(async to => {
|
||||
try {
|
||||
const { getPathAfterLanguage } = usePathResolver()
|
||||
//error 발생시에는 미들웨어 실행하지 않음
|
||||
//error 객체 조회
|
||||
if (!import.meta.client) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
const { getPathAfterLanguage } = usePathResolver()
|
||||
const pageUrl = getPathAfterLanguage(to.path)
|
||||
|
||||
// error 페이지는 API 호출하지 않음
|
||||
|
||||
@@ -103,7 +103,6 @@ export default defineNuxtRouteMiddleware(async (to, _from) => {
|
||||
loadingStore.startFullLoading()
|
||||
|
||||
const accessToken = csrGetAccessToken()
|
||||
|
||||
const headers = {
|
||||
Authorization: `Bearer ${accessToken}`,
|
||||
}
|
||||
|
||||
@@ -206,6 +206,25 @@ export default defineEventHandler(async event => {
|
||||
initDefaultLocale
|
||||
)
|
||||
setFinalLocaleCookie(event, finalLocale, baseDomain)
|
||||
|
||||
// 점검 페이지에서도 gameData를 가져와서 context에 설정
|
||||
try {
|
||||
const queryParams: Record<string, string> = {
|
||||
game_domain: cleanHost || '',
|
||||
lang_code: finalLocale,
|
||||
}
|
||||
const response = await $fetch<GameDataResponse>(apiUrl, {
|
||||
query: queryParams,
|
||||
})
|
||||
|
||||
if (response?.code === 0 && 'value' in response) {
|
||||
event.context.gameData = response.value
|
||||
event.context.googleAnalyticsId = response.value?.ga_code
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('inspection path gameData load error:', error)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -306,6 +325,7 @@ export default defineEventHandler(async event => {
|
||||
}
|
||||
)
|
||||
inspectionData = inspectionResponse?.value?.inspection
|
||||
console.log("🚀 ~ inspectionData:", inspectionData)
|
||||
cache.set(cacheKey, inspectionData) // 캐시에 저장
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user