fix: update ASSETS_URL paths in environment files and enable TypeScript type checking
This commit is contained in:
2
.env.dev
2
.env.dev
@@ -3,7 +3,7 @@ BASE_DOMAIN='.onstove.com'
|
||||
|
||||
# URLS ##############################################################################
|
||||
STATIC_URL='https://static-pubcomm.gate8.com'
|
||||
ASSETS_URL='https://static-pubcomm.gate8.com/dev/templates/brand'
|
||||
ASSETS_URL='https://static-pubcomm.gate8.com/dev/template/brand'
|
||||
DATA_RESOURCE_URL='https://static-pubcomm.gate8.com/dev/test'
|
||||
|
||||
# STOVE #############################################################################
|
||||
|
||||
@@ -3,7 +3,7 @@ BASE_DOMAIN='.onstove.com'
|
||||
|
||||
# URLS ##############################################################################
|
||||
STATIC_URL='https://static-pubcomm.onstove.com'
|
||||
ASSETS_URL='https://static-pubcomm.onstove.com/live/templates/brand'
|
||||
ASSETS_URL='https://static-pubcomm.onstove.com/live/template/brand'
|
||||
DATA_RESOURCE_URL='https://static-pubcomm.onstove.com/live/test'
|
||||
|
||||
# STOVE #############################################################################
|
||||
|
||||
2
.env.qa
2
.env.qa
@@ -3,7 +3,7 @@ BASE_DOMAIN='.onstove.com'
|
||||
|
||||
# URLS ##############################################################################
|
||||
STATIC_URL='https://static-pubcomm.gate8.com'
|
||||
ASSETS_URL='https://static-pubcomm.gate8.com/qa/templates/brand'
|
||||
ASSETS_URL='https://static-pubcomm.gate8.com/qa/template/brand'
|
||||
DATA_RESOURCE_URL='https://static-pubcomm.gate8.com/qa/test'
|
||||
|
||||
# STOVE #############################################################################
|
||||
|
||||
@@ -3,7 +3,7 @@ BASE_DOMAIN='.gate8.com'
|
||||
|
||||
# URLS ##############################################################################
|
||||
STATIC_URL='https://static-pubcomm.gate8.com'
|
||||
ASSETS_URL='https://static-pubcomm.gate8.com/sandbox/templates/brand'
|
||||
ASSETS_URL='https://static-pubcomm.gate8.com/sandbox/template/brand'
|
||||
DATA_RESOURCE_URL='https://static-pubcomm.gate8.com/sandbox/test'
|
||||
|
||||
# STOVE #############################################################################
|
||||
|
||||
@@ -9,6 +9,7 @@ const currentLayout = computed(() => getLayoutType(pageData.value))
|
||||
|
||||
definePageMeta({
|
||||
layout: false, // 동적 레이아웃을 위해 기본 레이아웃 비활성화
|
||||
middleware: 'inspection',
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ export default defineNuxtRouteMiddleware(async (to) => {
|
||||
// domain: baseDomain
|
||||
// })
|
||||
|
||||
const finalLocale = csrGetFinalLocale(to.path)
|
||||
const finalLocale = csrGetFinalLocale(to.path, gameData.value.lang_codes)
|
||||
// localeCookie.value = finalLocale.toUpperCase()
|
||||
|
||||
// 웹 점검 -----
|
||||
|
||||
@@ -157,8 +157,8 @@ export default defineEventHandler(async event => {
|
||||
// 1-2. /inspection 패스
|
||||
if (fullPath.includes('/inspection')) {
|
||||
// 리턴 되기 전 언어 쿠키 세팅
|
||||
const finalLocale = ssrGetFinalLocale(event?.node.req.url, event.node.req.headers)
|
||||
setFinalLocaleCookie(event, finalLocale, baseDomain)
|
||||
// const finalLocale = ssrGetFinalLocale(event?.node.req.url, event.node.req.headers)
|
||||
// setFinalLocaleCookie(event, finalLocale, baseDomain)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -196,8 +196,9 @@ export default defineEventHandler(async event => {
|
||||
// console.log("🚀 ~ apiUrl:", apiUrl)
|
||||
|
||||
// 2. 언어 코드 추출
|
||||
const finalLocale = ssrGetFinalLocale(event?.node.req.url, event.node.req.headers)
|
||||
// const finalLocale = ssrGetFinalLocale(event?.node.req.url, event.node.req.headers)
|
||||
|
||||
const finalLocale = ssrGetFinalLocale(event?.node.req.url, event.node.req.headers)
|
||||
|
||||
const queryParams: Record<string, string> = {
|
||||
game_domain: event.context.gameDomain || '',
|
||||
@@ -213,6 +214,8 @@ export default defineEventHandler(async event => {
|
||||
// setFinalLocaleCookie(event, finalLocale, baseDomain)
|
||||
// }
|
||||
|
||||
|
||||
|
||||
if (response?.code === 0 && 'value' in response) {
|
||||
event.context.gameData = response.value
|
||||
event.context.googleAnalyticsId = response.value?.ga_code
|
||||
|
||||
@@ -32,7 +32,7 @@ const parseCookies = (cookieHeader: string) => {
|
||||
*
|
||||
* @param {string} path - 현재 URL 경로
|
||||
*/
|
||||
export const csrGetFinalLocale = (path = '') => {
|
||||
export const csrGetFinalLocale = (path = '', coveragesLocales: string[]) => {
|
||||
const config = useRuntimeConfig()
|
||||
const baseDomain = `${config.public.baseDomain}`
|
||||
|
||||
@@ -101,7 +101,7 @@ export const ssrGetFinalLocale = (path = '', headers: any) => {
|
||||
const cookieHeader = headers.cookie || ''
|
||||
const cookies = parseCookies(cookieHeader)
|
||||
const cookieLanguage = cookies.LOCALE ? `${cookies.LOCALE}`.toLowerCase() : ''
|
||||
if (cookieLanguage && cookieLanguage !== '' && coveragesLocales.includes(cookieLanguage)) {
|
||||
if (cookieLanguage && cookieLanguage !== '') {
|
||||
finalLocale = cookieLanguage
|
||||
return finalLocale
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ export default defineNuxtConfig({
|
||||
payloadExtraction: false,
|
||||
},
|
||||
typescript: {
|
||||
typeCheck: false,
|
||||
typeCheck: true,
|
||||
strict: false,
|
||||
},
|
||||
nitro: {
|
||||
|
||||
Reference in New Issue
Block a user