初始化2

This commit is contained in:
2026-04-08 17:10:58 +08:00
commit 4986d90eb9
532 changed files with 112617 additions and 0 deletions

27
app/app.vue Normal file
View File

@@ -0,0 +1,27 @@
<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>