Files
tiantian-system/app/app.vue
2026-04-08 17:10:58 +08:00

28 lines
736 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<ClientOnly>
<a-config-provider :locale="zhCN">
<NuxtLayout>
<NuxtRouteAnnouncer />
<NuxtPage />
</NuxtLayout>
</a-config-provider>
</ClientOnly>
</template>
<script setup lang="ts">
import { getCurrentEnv } from '@/config/setting'
import zhCN from 'ant-design-vue/es/locale/zh_CN'
import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn'
// 设置 dayjs 默认语言为中文
dayjs.locale('zh-cn')
// 初始化时同步环境设置到 Cookie确保服务器端代理能正确识别
if (import.meta.client) {
const env = getCurrentEnv()
const cookieValue = env === 'dev' ? 'dev' : 'prod'
document.cookie = `websopy_api_env=${cookieValue}; path=/; max-age=31536000`
}
</script>