fix: [PWT-163] [front] Footer > JA 푸터 자금 결제법 URL 설정 오류
This commit is contained in:
@@ -232,7 +232,21 @@ import type {
|
|||||||
DevCiConfig,
|
DevCiConfig,
|
||||||
} from '#layers/types/Common'
|
} from '#layers/types/Common'
|
||||||
|
|
||||||
const { tm, locale }: any = useI18n()
|
// Configuration
|
||||||
|
const runtimeConfig = useRuntimeConfig()
|
||||||
|
const dataResourcesUrl = runtimeConfig.public.dataResourcesUrl as string
|
||||||
|
const multilingualFileName = 'STOVE_PUBTEMPLATE_homepage_brand_footer.json'
|
||||||
|
|
||||||
|
// Multilingual
|
||||||
|
const resultGetMultilingual = await useGetMultilingual({
|
||||||
|
baseApiUrl: dataResourcesUrl,
|
||||||
|
fileName: multilingualFileName,
|
||||||
|
})
|
||||||
|
const { tm, locale }: any = useI18n({
|
||||||
|
useScope: 'local',
|
||||||
|
messages: Object(resultGetMultilingual?.value?.multilingual),
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
// Footer_caution 값이 있고 빈 객체가 아닌지 체크
|
// Footer_caution 값이 있고 빈 객체가 아닌지 체크
|
||||||
const hasCautionText = computed(() => {
|
const hasCautionText = computed(() => {
|
||||||
@@ -266,22 +280,25 @@ const footerLinks = computed((): FooterMenuItem[] => {
|
|||||||
const menu = (tm as any)('Footer_Menu')
|
const menu = (tm as any)('Footer_Menu')
|
||||||
const menuItems = Array.isArray(menu) ? (menu as FooterMenuItem[]) : []
|
const menuItems = Array.isArray(menu) ? (menu as FooterMenuItem[]) : []
|
||||||
|
|
||||||
// ja일 때 fund_display_yn에 따라 4번째 항목 처리
|
// ja일 때 fund_display_yn에 따라 id가 footerFund인 항목 처리
|
||||||
if (locale.value === 'ja') {
|
if (locale.value === 'ja') {
|
||||||
const fundDisplayYn = footerData.value?.fund_display_yn
|
const fundDisplayYn = footerData.value?.fund_display_yn
|
||||||
const fundDisplayUrl = footerData.value?.fund_display_url
|
const fundDisplayUrl = footerData.value?.fund_display_url
|
||||||
|
|
||||||
// fund_display_yn이 'y'가 아니면 4번째 항목 제거
|
// id가 footerFund인 항목의 인덱스 찾기
|
||||||
if (fundDisplayYn !== 'y') {
|
const fundIndex = menuItems.findIndex((item: any) => item.id === 'footerFund')
|
||||||
return menuItems.filter((_, index) => index !== 3)
|
|
||||||
|
// fund_display_yn이 'y'가 아니면 id가 footerFund인 항목 제거
|
||||||
|
if (!fundDisplayYn) {
|
||||||
|
return menuItems.filter((item: any) => item.id !== 'footerFund')
|
||||||
}
|
}
|
||||||
|
|
||||||
// fund_display_yn이 'y'이면 4번째 항목의 url 설정
|
// fund_display_yn이 'y'이면 id가 footerFund인 항목의 url 설정
|
||||||
if (fundDisplayYn === 'y' && menuItems[3]) {
|
if (fundDisplayYn && fundIndex !== -1) {
|
||||||
const updatedMenuItems = [...menuItems]
|
const updatedMenuItems = [...menuItems]
|
||||||
updatedMenuItems[3] = {
|
updatedMenuItems[fundIndex] = {
|
||||||
...updatedMenuItems[3],
|
...updatedMenuItems[fundIndex],
|
||||||
url: fundDisplayUrl || updatedMenuItems[3].url
|
url: fundDisplayUrl || updatedMenuItems[fundIndex].url
|
||||||
}
|
}
|
||||||
return updatedMenuItems
|
return updatedMenuItems
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ export default defineNuxtRouteMiddleware(async (to, _from) => {
|
|||||||
|
|
||||||
// 루트 경로(언어 코드만 있는 경로)로 접근할 때만 intro.page_url로 리다이렉트
|
// 루트 경로(언어 코드만 있는 경로)로 접근할 때만 intro.page_url로 리다이렉트
|
||||||
const isRootPath = !pageUrl || pageUrl === '' || pageUrl === '/' || pageUrl === `/${langCode}/`
|
const isRootPath = !pageUrl || pageUrl === '' || pageUrl === '/' || pageUrl === `/${langCode}/`
|
||||||
|
console.log("🚀 ~ isRootPath:", isRootPath)
|
||||||
|
|
||||||
if (isRootPath) {
|
if (isRootPath) {
|
||||||
// gameData.intro.page_url이 있으면 해당 URL로 리다이렉트
|
// gameData.intro.page_url이 있으면 해당 URL로 리다이렉트
|
||||||
@@ -145,6 +146,22 @@ export default defineNuxtRouteMiddleware(async (to, _from) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (response?.code === 91002 && response?.message === 'Invalid LangCode') {
|
||||||
|
//클릭한 주소는 주소표시줄에 표시하도록 수정
|
||||||
|
if (import.meta.client) {
|
||||||
|
window.history.replaceState({}, '', to.path)
|
||||||
|
}
|
||||||
|
// 뒤로가기 이동 시 이전 페이지로 이동되도록 수정
|
||||||
|
showError(
|
||||||
|
createError({
|
||||||
|
statusCode: 404,
|
||||||
|
statusMessage: '페이지를 찾을 수 없어요.',
|
||||||
|
fatal: false, // 즉시 에러 페이지로
|
||||||
|
data: { reason: 'post-not-found Invalid LangCode' },
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
if (response?.code === 91003) {
|
if (response?.code === 91003) {
|
||||||
// return navigateTo(`/${langCode}/error`, { external: false })
|
// return navigateTo(`/${langCode}/error`, { external: false })
|
||||||
//클릭한 주소는 주소표시줄에 표시하도록 수정
|
//클릭한 주소는 주소표시줄에 표시하도록 수정
|
||||||
|
|||||||
Reference in New Issue
Block a user