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