fix. api 수정 반영, getImageHost 수정

This commit is contained in:
clkim
2025-11-04 10:16:24 +09:00
parent 9f1fbbeec1
commit 61b1ab2057
7 changed files with 21 additions and 18 deletions

View File

@@ -30,7 +30,7 @@ const getGameDataFromServer = (): GameDataValue | null => {
const setupAllMetaData = (data: GameDataValue) => {
const meta = data.meta_tag_json ?? ({} as GameDataMetaTag)
const faviconPath = data.favicon_json ?? ({} as GameDataFavicon)
const theme = data.gnb?.theme_type ?? 'dark'
const theme = data.design_theme === 1 ? 'dark' : 'light'
// 파비콘 링크 생성
const faviconLinks = [

View File

@@ -1,21 +1,25 @@
/* Button Size Classes */
@layer components {
.size-large {
/* height: 64px */
@apply px-10 h-16 text-lg rounded-lg
before:rounded after:rounded;
}
.size-medium {
/* height: 56px */
@apply px-10 h-14 text-base rounded-lg
before:rounded after:rounded;
}
.size-small {
/* height: 48px */
@apply px-10 h-12 text-sm rounded-lg
before:rounded after:rounded;
}
.size-extra-small {
/* height: 40px */
@apply px-6 h-10 text-sm rounded
before:rounded after:rounded;
}

View File

@@ -13,7 +13,7 @@
@apply overflow-hidden relative pt-[32px] pb-[80px] px-[20px] sm:px-[40px] md:pt-[64px] md:pb-[200px] bg-[#F0F0F0];
}
.section-static {
@apply mx-auto lg:max-w-[1300px];
@apply max-w-[1300px] mx-auto;
}
.section-static + .section-static {
@apply mt-[80px] md:mt-[100px];

View File

@@ -1,15 +1,18 @@
import type { GameDataResponse, GameDataRequest } from '#layers/types/api/gameData'
import type {
GameDataResponse,
GameDataRequest,
} from '#layers/types/api/gameData'
export const useGetGameDataExternal = () => {
const { setGameData } = useGameDataStore()
const logPrefix = {
exception: '[Exception] /composables/useGetGameDataExternal',
failure: '[Failure] /composables/useGetGameDataExternal'
failure: '[Failure] /composables/useGetGameDataExternal',
}
const webGameData = ref<GameDataResponse | null>(null)
const getGameDataExternal = async (req: GameDataRequest) => {
console.log("🚀 ~ getGameDataExternal ~ req:", req)
console.log('🚀 ~ getGameDataExternal ~ req:', req)
// const config = useRuntimeConfig()
const config = useRuntimeConfig()
const stoveApiUrl = `${config.public.stoveApiUrl}`
@@ -17,7 +20,7 @@ export const useGetGameDataExternal = () => {
try {
const response = (await commonFetch('GET', apiUrl)) as GameDataResponse
console.log("🚀 ~ getGameDataExternal ~ response:", response)
console.log('🚀 ~ getGameDataExternal ~ response:', response)
// FIXME: 테스트용 데이터 ---------------------------------------------------
/* if (['local', 'local-gate8', 'dev'].includes(`${config.public.runType}`)) {
@@ -38,16 +41,13 @@ export const useGetGameDataExternal = () => {
} */
// ------------------------------------------------------------------------
if (response?.value) {
webGameData.value = response
setGameData(response.value)
}
} catch (e) {
console.error(`${logPrefix.exception}.getGameDataExternal: `, e)
}
}
return { webGameData, getGameDataExternal }

View File

@@ -16,10 +16,10 @@ export default defineNuxtRouteMiddleware(async (to, _from) => {
const apiUrl = `${stoveApiBaseUrl}/pub-comm/v2.0/template/page`
try {
if(to.path.includes('inspection')) {
if (to.path.includes('inspection')) {
return
}
const pageUrl = getPathAfterLanguage(to.path)
// pageUrl이 빈값이거나 null이면 /brand로 리다이렉트
@@ -40,7 +40,7 @@ export default defineNuxtRouteMiddleware(async (to, _from) => {
loading: true,
})) as PageDataResponse | null
console.log("🚀 ~ response?.code:", response?.code)
console.log('🚀 ~ response?.code:', response?.code)
// if(response?.code === 91003) {
// throw createError({
// statusCode: 404,
@@ -50,7 +50,7 @@ export default defineNuxtRouteMiddleware(async (to, _from) => {
if (response?.code === 0 && 'value' in response) {
store.setPageData(response.value)
// console.log('🚀 ~ pageData:', response.value)
console.log('🚀 ~ pageData:', response.value)
} else {
store.clearPageData()
}

View File

@@ -181,7 +181,6 @@ export interface GameDataMenu {
// GNB 설정 타입
export interface GameDataGnb {
game_gnb_ver: string
theme_type: string
bi_path: string
lang_codes: string // JSON 문자열로 변경
buttons: GameDataButton[]

View File

@@ -28,18 +28,18 @@ export const getImageHost = (
const { imageType = 'game' } = options
const isDevelopment = process.env.NODE_ENV === 'development'
const isCommon = imageType === 'common'
const isTypeGame = imageType === 'game'
// * [TODO] 수정 필요 : 게임별 이미지 로컬에 추가 필요.
if (!isCommon) {
if (isTypeGame) {
return `${staticUrl}${path}`
}
// 개발 환경일 때는 루트 경로 생략
if (isDevelopment) return path
// 공통/게임 여부에 따른 경로 결정
const basePath = isCommon ? assetsUrl : staticUrl
// 게임/공통 여부에 따른 경로 결정
const basePath = isTypeGame ? staticUrl : assetsUrl
return `${basePath}${path}`
}