fix. getResourceHost 함수명 변경

This commit is contained in:
clkim
2025-11-25 17:02:35 +09:00
parent a6027036d2
commit 8757a55378
13 changed files with 33 additions and 48 deletions

View File

@@ -1,6 +1,5 @@
<script setup lang="ts">
import { useNuxtApp } from 'nuxt/app'
import { getImageHost } from '#layers/utils/styleUtil'
import type {
GameDataFavicon,
GameDataMetaTag,
@@ -15,7 +14,7 @@ const scrollStore = useScrollStore()
const { setGameData } = gameDataStore
const { gameData } = storeToRefs(gameDataStore)
const { youtube, confirm, alert, content, handleResetYoutube } = modalStore
const { confirm, alert } = modalStore
const { scrollGnbPosition } = storeToRefs(scrollStore)
const metaData = ref<GameDataMetaTag | null>(null)
@@ -38,16 +37,16 @@ const setupAllMetaData = (data: GameDataValue) => {
{
rel: 'icon',
type: 'image/x-icon',
href: getImageHost(faviconPath[0]),
href: getResourceHost(faviconPath[0]),
},
{
rel: 'apple-touch-icon',
href: getImageHost(faviconPath[1]),
href: getResourceHost(faviconPath[1]),
},
{
rel: 'icon',
type: 'image/png',
href: getImageHost(faviconPath[2]),
href: getResourceHost(faviconPath[2]),
},
]
@@ -60,7 +59,7 @@ const setupAllMetaData = (data: GameDataValue) => {
data.comm_img_json?.groups
?.map(
({ img_name, img_path }) =>
`--${img_name}: url(${getImageHost(img_path?.comm ?? '')});`
`--${img_name}: url(${getResourceHost(img_path?.comm ?? '')});`
)
.join('\n ') ?? ''
@@ -168,21 +167,8 @@ onBeforeUnmount(() => {
<!-- 공통 모달 컴포넌트 -->
<WidgetsModalClient />
<BlocksModalContent
v-model:is-open="content.storeIsOpen"
:is-outside-close="content.storeIsOutsideClose"
:content-title="content.storeContentTitle"
:tab-info="content.storeTabInfo"
:tab-active-index="content.storeTabActiveIndex"
:modal-name="content.storeModalName"
/>
<BlocksModalYouTube
v-model:is-open="youtube.storeIsOpen"
:youtube-url="youtube.storeYoutubeUrl"
:is-outside-close="youtube.storeIsOutsideClose"
:modal-name="youtube.storeModalName"
@close-button-event="handleResetYoutube"
/>
<BlocksModalYouTube />
<BlocksModalContent />
<BlocksModalConfirm
v-model:is-open="confirm.storeIsOpen"
:is-show-dimmed="confirm.storeIsShowDimmed"

View File

@@ -213,7 +213,7 @@ const enabledMarkets = computed(() => {
const logoImgUrl = computed(() => {
const currentLocale = locale.value || 'ko'
const localeData = (webInspectionData.value as any)?.[currentLocale]
return getImageHost(localeData.img_json.bi_large)
return getResourceHost(localeData.img_json.bi_large)
})
const communityUrl = computed(() => {

View File

@@ -15,7 +15,7 @@ interface props {
const props = withDefaults(defineProps<props>(), {
type: 'action',
buttonSize: 'size-small md:size-large',
target: '_blank',
target: '_self',
backgroundColor: 'var(--primary)',
textColor: 'var(--alternative-02)',
disabled: false,

View File

@@ -16,7 +16,7 @@ const isResponsiveMode = computed(() => {
const imagePaths = computed(() => {
if (typeof props.src === 'string') {
const resolved = getImageHost(props.src, {
const resolved = getResourceHost(props.src, {
imageType: props.imageType,
})
return { pc: '', mo: resolved }
@@ -24,12 +24,12 @@ const imagePaths = computed(() => {
return {
pc: props.src.pc
? getImageHost(props.src.pc, {
? getResourceHost(props.src.pc, {
imageType: props.imageType,
})
: '',
mo: props.src.mo
? getImageHost(props.src.mo, {
? getResourceHost(props.src.mo, {
imageType: props.imageType,
})
: '',

View File

@@ -61,7 +61,7 @@ const inlineStyle = computed<CSSProperties>(() => {
style.color = props.textColor
}
if (props.type === 'duplication') {
style.backgroundImage = `url(${getImageHost(DUP_IMAGE_MAP[props.platform], { imageType: 'common' })})`
style.backgroundImage = `url(${getResourceHost(DUP_IMAGE_MAP[props.platform], { imageType: 'common' })})`
}
return style
})

View File

@@ -64,7 +64,7 @@ const handleCopy = async () => {
target="_blank"
class="sns-item"
:style="{
backgroundImage: `url(${getImageHost(`/images/common/ic-v2-logo-${key}-fill.png`, { imageType: 'common' })})`,
backgroundImage: `url(${getResourceHost(`/images/common/ic-v2-logo-${key}-fill.png`, { imageType: 'common' })})`,
}"
>
<span class="sr-only">{{ key }}</span>
@@ -74,7 +74,7 @@ const handleCopy = async () => {
type="button"
class="sns-item"
:style="{
backgroundImage: `url(${getImageHost('/images/common/ic-v2-community-link-line.png', { imageType: 'common' })})`,
backgroundImage: `url(${getResourceHost('/images/common/ic-v2-community-link-line.png', { imageType: 'common' })})`,
}"
@click="handleCopy"
>

View File

@@ -174,7 +174,7 @@
<a href="https://www.smilegate.com" target="_blank" class="smilegate">
<img
:src="
getImageHost(`/images/common/logo_smilegate.png`, {
getResourceHost(`/images/common/logo_smilegate.png`, {
imageType: 'common',
})
"
@@ -190,7 +190,7 @@
>
<img
:src="
getImageHost(`${setDevCi.dev_ci_img_path}`, {
getResourceHost(`${setDevCi.dev_ci_img_path}`, {
imageType: 'game',
})
"
@@ -240,7 +240,7 @@ const getGameRatingImage = computed((): string[] => {
}
return contentInfo.map(item => {
const type = ageTypeMap[item] || 'TypeTest'
return getImageHost(`/images/common/grades_age/${type}.svg`, {
return getResourceHost(`/images/common/grades_age/${type}.svg`, {
imageType: 'common',
})
})
@@ -264,7 +264,7 @@ const getContentInfoImage = computed((): string[] => {
.map(item => {
const type = contentTypeMap[item]
return type
? getImageHost(`/images/common/grades_use/${type}.svg`, {
? getResourceHost(`/images/common/grades_use/${type}.svg`, {
imageType: 'common',
})
: ''

View File

@@ -232,7 +232,7 @@ onMounted(() => {
>
<AtomsLocaleLink to="/" class="mx-auto md:hidden">
<img
:src="getImageHost(gnbData?.bi_path)"
:src="getResourceHost(gnbData?.bi_path)"
:alt="gameData?.game_name"
class="h-[30px]"
/>
@@ -249,7 +249,7 @@ onMounted(() => {
<div class="nav-logo">
<AtomsLocaleLink to="/" @click="handleMenuClose">
<img
:src="getImageHost(gnbData?.bi_path)"
:src="getResourceHost(gnbData?.bi_path)"
:alt="gameData?.game_name"
class="h-[30px]"
/>

View File

@@ -152,7 +152,7 @@ const handleMoveFocus = (target: 'pc' | 'mobile') => {
>
<img
:src="
getImageHost('/images/common/img_desktop.png', {
getResourceHost('/images/common/img_desktop.png', {
imageType: 'common',
})
"
@@ -379,7 +379,7 @@ const handleMoveFocus = (target: 'pc' | 'mobile') => {
<div class="flex items-center justify-center w-full">
<img
:src="
getImageHost(
getResourceHost(
`/images/common/grades_driver/Type-${driver.driverCode}.svg`,
{ imageType: 'common' }
)

View File

@@ -1,7 +1,6 @@
<script setup lang="ts">
import { getComponentGroup } from '#layers/utils/dataUtil'
import type { PageDataTemplateComponents } from '#layers/types/api/pageData'
import { getImageHost } from '#layers/utils/styleUtil'
// Props
interface Props {
@@ -233,7 +232,7 @@ onMounted(() => {
>
<img
:src="
getImageHost(card.benefitIcon, { imageType: 'common' })
getResourceHost(card.benefitIcon, { imageType: 'common' })
"
:alt="card.benefitTitle"
class="w-[48px] h-[48px] object-contain rounded-2xl"

View File

@@ -139,7 +139,7 @@ const onArrowClick = (direction, targetIndex) => {
<BlocksCardNews
:title="item.title"
:description="globalDateFormat(item.create_datetime, locale)"
:img-path="getImageHost(item.media_thumbnail_url)"
:img-path="getResourceHost(item.media_thumbnail_url)"
:url="getArticleUrl(item.article_id)"
link-target="_blank"
/>

View File

@@ -5,7 +5,7 @@ import {
getComponentGroup,
getComponentContainer,
} from '#layers/utils/dataUtil'
import { getImageHost } from '#layers/utils/styleUtil'
import { getResourceHost } from '#layers/utils/styleUtil'
import type { PageDataTemplateComponents } from '#layers/types/api/pageData'
import type { OperateGroupItem } from '#layers/types/api/operateResources'
@@ -118,7 +118,7 @@ const onArrowClick = direction => {
<BlocksCardNews
:title="item.title"
:description="globalDateFormat(item.reg_dt, locale)"
:img-path="getImageHost(item.img_path)"
:img-path="getResourceHost(item.img_path)"
:url="item.url"
:link-target="item.link_target"
class="slide-inner"

View File

@@ -13,11 +13,11 @@ import type {
} from '#layers/types/api/pageData'
/**
* 이미지 경로를 완전한 호스트 URL로 변환합니다.
* @param path 이미지 경로
* @returns 완전한 이미지 URL
* 리소스 경로를 완전한 호스트 URL로 변환합니다.
* @param path 리소스 경로
* @returns 완전한 리소스 URL
*/
export const getImageHost = (
export const getResourceHost = (
path: string,
options: { imageType?: 'common' | 'game' } = {}
): string => {
@@ -71,8 +71,8 @@ export const getDeviceSrc = (
if (!pcPath && !mobilePath) return null
const resolvedImages = {
pc: pcPath ? getImageHost(pcPath, { imageType }) : '',
mobile: mobilePath ? getImageHost(mobilePath, { imageType }) : '',
pc: pcPath ? getResourceHost(pcPath, { imageType }) : '',
mobile: mobilePath ? getResourceHost(mobilePath, { imageType }) : '',
}
return {