fix. formatPathHost 파라미터 직관적으로 명칭 수정
This commit is contained in:
@@ -2,13 +2,13 @@
|
||||
interface Props {
|
||||
src: string | { pc?: string; mo?: string }
|
||||
alt?: string
|
||||
imageType?: 'common' | 'game'
|
||||
imageType?: 'public' | 'cdn'
|
||||
priority?: 'high' | 'low' | 'auto'
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
alt: 'image',
|
||||
imageType: 'game',
|
||||
imageType: 'cdn',
|
||||
priority: 'auto',
|
||||
})
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ const buttonStyle = computed<CSSProperties>(() => {
|
||||
style.backgroundColor = props.backgroundColor
|
||||
}
|
||||
if (props.type === 'duplication') {
|
||||
style.backgroundImage = `url(${formatPathHost(DUP_IMAGE_MAP[props.platform], { imageType: 'common' })})`
|
||||
style.backgroundImage = `url(${formatPathHost(DUP_IMAGE_MAP[props.platform], { imageType: 'public' })})`
|
||||
}
|
||||
|
||||
return style
|
||||
|
||||
@@ -71,7 +71,7 @@ const handleCopy = async () => {
|
||||
height="100%"
|
||||
:src="
|
||||
formatPathHost(`/images/common/ic-v2-logo-${key}-fill.png`, {
|
||||
imageType: 'common',
|
||||
imageType: 'public',
|
||||
})
|
||||
"
|
||||
:alt="key"
|
||||
@@ -88,7 +88,7 @@ const handleCopy = async () => {
|
||||
height="100%"
|
||||
:src="
|
||||
formatPathHost('/images/common/ic-v2-community-link-line.png', {
|
||||
imageType: 'common',
|
||||
imageType: 'public',
|
||||
})
|
||||
"
|
||||
alt="copy"
|
||||
|
||||
@@ -101,7 +101,7 @@ const getGameRatingImage = computed((): { type: string; image: string } => {
|
||||
image: formatPathHost(
|
||||
`/images/common/grades_age/${locale.value}/${type}.svg`,
|
||||
{
|
||||
imageType: 'common',
|
||||
imageType: 'public',
|
||||
}
|
||||
),
|
||||
}
|
||||
@@ -134,7 +134,7 @@ const getContentInfoImage = computed((): string[] => {
|
||||
const type = contentTypeMap[item]
|
||||
return type
|
||||
? formatPathHost(`/images/common/grades_use/${type}.svg`, {
|
||||
imageType: 'common',
|
||||
imageType: 'public',
|
||||
})
|
||||
: ''
|
||||
})
|
||||
@@ -331,7 +331,7 @@ const footerAgeRatingInfo = computed((): string[] => {
|
||||
<img
|
||||
:src="
|
||||
formatPathHost(`/images/common/logo_smilegate.png`, {
|
||||
imageType: 'common',
|
||||
imageType: 'public',
|
||||
})
|
||||
"
|
||||
width="114px"
|
||||
@@ -344,12 +344,12 @@ const footerAgeRatingInfo = computed((): string[] => {
|
||||
v-if="footerData.use_dev_ci_url"
|
||||
:href="footerData.dev_ci_url"
|
||||
target="_blank"
|
||||
class="block nx3"
|
||||
class="block"
|
||||
>
|
||||
<img
|
||||
:src="
|
||||
formatPathHost(`${setDevCi.dev_ci_img_path}`, {
|
||||
imageType: 'game',
|
||||
imageType: 'cdn',
|
||||
})
|
||||
"
|
||||
alt="CI"
|
||||
@@ -361,7 +361,7 @@ const footerAgeRatingInfo = computed((): string[] => {
|
||||
v-else
|
||||
:src="
|
||||
formatPathHost(`${setDevCi.dev_ci_img_path}`, {
|
||||
imageType: 'game',
|
||||
imageType: 'cdn',
|
||||
})
|
||||
"
|
||||
alt="CI"
|
||||
|
||||
@@ -397,7 +397,7 @@ defineExpose({
|
||||
<AtomsImg
|
||||
src="/images/common/stove_app_qr.png"
|
||||
alt="STOVE APP QR Code"
|
||||
image-type="common"
|
||||
image-type="public"
|
||||
class="w-full h-full object-contain"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -37,7 +37,7 @@ export const useResponsiveSrc = () => {
|
||||
const getCurrentSrc = (
|
||||
resourcesData: PageDataResourceGroup,
|
||||
options?: {
|
||||
imageType?: 'game' | 'common'
|
||||
imageType?: 'public' | 'cdn'
|
||||
resourcesType?: 'IMG' | 'VID'
|
||||
}
|
||||
) => {
|
||||
|
||||
@@ -573,11 +573,8 @@ onMounted(async () => {
|
||||
class="relative flex items-center justify-start"
|
||||
>
|
||||
<template v-for="month in monthSelectList" :key="month">
|
||||
<AtomsButton
|
||||
type="action"
|
||||
size="size-small"
|
||||
background-color="#FAFAFA"
|
||||
text-color="#CCCCCC"
|
||||
<button
|
||||
type="button"
|
||||
:class="[
|
||||
'btn-period',
|
||||
{ 'btn-period-active': currentSearchPeriod === month },
|
||||
@@ -585,7 +582,7 @@ onMounted(async () => {
|
||||
@click="handlePeriodSelect(month)"
|
||||
>
|
||||
<span>{{ tm(`Coupon_Month${month}`) }}</span>
|
||||
</AtomsButton>
|
||||
</button>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
@@ -821,9 +818,9 @@ onMounted(async () => {
|
||||
<style scoped>
|
||||
/* Button Style */
|
||||
.btn-period {
|
||||
@apply border border-solid border-[#D9D9D9] rounded-[0] w-auto h-[40px] px-[16px] font-[700] before:content-none after:content-none
|
||||
@apply border w-auto h-[40px] border-solid border-[#D9D9D9] bg-[#FAFAFA] px-[16px] font-[700] text-[14px] leading-[24px] tracking-[-0.42px] text-[#999999]
|
||||
transition-all duration-300 ease-in-out
|
||||
hover:z-[4] hover:!bg-[#FFFFFF] hover:border-[#404040] hover:!text-[#1F1F1F];
|
||||
hover:z-[4] hover:bg-[#FFFFFF] hover:border-[#404040] hover:text-[#1F1F1F];
|
||||
}
|
||||
.btn-period + .btn-period {
|
||||
@apply ml-[-1px];
|
||||
@@ -835,7 +832,7 @@ onMounted(async () => {
|
||||
@apply rounded-r-[8px];
|
||||
}
|
||||
.btn-period.btn-period-active {
|
||||
@apply z-[4] !bg-[#FFFFFF] !border-[#404040] !text-[#1F1F1F];
|
||||
@apply z-[4] bg-[#FFFFFF] border-[#404040] text-[#1F1F1F];
|
||||
}
|
||||
|
||||
/* Table Style */
|
||||
|
||||
@@ -165,7 +165,7 @@ const handleMoveFocus = (target: 'pc' | 'mobile') => {
|
||||
<img
|
||||
:src="
|
||||
formatPathHost('/images/common/img_desktop.png', {
|
||||
imageType: 'common',
|
||||
imageType: 'public',
|
||||
})
|
||||
"
|
||||
:alt="tm('Download_Box_PC_Title')"
|
||||
@@ -425,7 +425,7 @@ const handleMoveFocus = (target: 'pc' | 'mobile') => {
|
||||
:src="
|
||||
formatPathHost(
|
||||
`/images/common/download_driver/Type-${driver.driverCode}.svg`,
|
||||
{ imageType: 'common' }
|
||||
{ imageType: 'public' }
|
||||
)
|
||||
"
|
||||
:alt="driver.driverText"
|
||||
|
||||
@@ -294,7 +294,7 @@ onMounted(() => {
|
||||
<img
|
||||
:src="
|
||||
formatPathHost(card.benefitIcon, {
|
||||
imageType: 'common',
|
||||
imageType: 'public',
|
||||
})
|
||||
"
|
||||
:alt="card.benefitTitle"
|
||||
|
||||
@@ -52,7 +52,7 @@ export const formatPathWithoutLocale = (path: string): string => {
|
||||
*/
|
||||
export const formatPathHost = (
|
||||
path: string,
|
||||
options: { imageType?: 'common' | 'game'; isSkipHost?: boolean } = {}
|
||||
options: { imageType?: 'public' | 'cdn'; isSkipHost?: boolean } = {}
|
||||
): string => {
|
||||
if (!path) return ''
|
||||
|
||||
@@ -60,18 +60,18 @@ export const formatPathHost = (
|
||||
|
||||
const runtimeConfig = useRuntimeConfig()
|
||||
const { staticUrl, assetsUrl } = runtimeConfig.public
|
||||
const { imageType = 'game', isSkipHost = false } = options
|
||||
const { imageType = 'cdn', isSkipHost = false } = options
|
||||
|
||||
const isDevelopment = import.meta.dev
|
||||
const isTypeGame = imageType === 'game'
|
||||
const isTypeCdn = imageType === 'cdn'
|
||||
|
||||
if (isSkipHost) return path
|
||||
|
||||
// 개발 환경일 때는 루트 경로 생략
|
||||
if (!isTypeGame && isDevelopment) return path
|
||||
if (!isTypeCdn && isDevelopment) return path
|
||||
|
||||
// 게임/공통 여부에 따른 경로 결정
|
||||
const basePath = isTypeGame ? staticUrl : assetsUrl
|
||||
const basePath = isTypeCdn ? staticUrl : assetsUrl
|
||||
|
||||
return `${basePath}${path}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user