feat(app): 初始化项目配置和页面结构
- 添加 .dockerignore 和 .env.example 配置文件 - 添加 .gitignore 忽略规则配置 - 创建服务端代理API路由(_file、_modules、_server) - 集成 Ant Design Vue 组件库并配置SSR样式提取 - 定义API响应类型封装 - 创建基础布局组件(blank、console) - 实现应用中心页面和组件(AppsCenter) - 添加文章列表测试页面 - 配置控制台导航菜单结构 - 实现控制台头部组件 - 创建联系页面表单
This commit is contained in:
92
nuxt.config.ts
Normal file
92
nuxt.config.ts
Normal file
@@ -0,0 +1,92 @@
|
||||
function getOrigin(url: string) {
|
||||
try {
|
||||
return new URL(url).origin
|
||||
} catch {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
|
||||
const tenantId = process.env.NUXT_PUBLIC_TENANT_ID || '10398'
|
||||
const serverApiBase =
|
||||
process.env.NUXT_PUBLIC_SERVER_API_BASE ||
|
||||
process.env.NUXT_PUBLIC_SERVER_API ||
|
||||
process.env.SERVER_API_URL ||
|
||||
process.env.VITE_SERVER_URL ||
|
||||
'https://server.websoft.top/api'
|
||||
const modulesApiBase =
|
||||
process.env.NUXT_PUBLIC_MODULES_API_BASE ||
|
||||
process.env.MODULES_API_URL ||
|
||||
process.env.NUXT_PUBLIC_CMS_API_BASE ||
|
||||
process.env.API_BASE ||
|
||||
'https://cms-api.websoft.top/api'
|
||||
const fileServerBase =
|
||||
process.env.NUXT_PUBLIC_FILE_SERVER_BASE ||
|
||||
process.env.FILE_SERVER_BASE ||
|
||||
getOrigin(serverApiBase) ||
|
||||
'https://server.websoft.top'
|
||||
|
||||
const WATCH_IGNORED = [
|
||||
'**/.git/**',
|
||||
'**/node_modules/**',
|
||||
'**/.nuxt/**',
|
||||
'**/.output/**',
|
||||
'**/dist/**',
|
||||
'**/coverage/**',
|
||||
'**/.cache/**'
|
||||
]
|
||||
|
||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||
export default defineNuxtConfig({
|
||||
compatibilityDate: '2025-07-15',
|
||||
devtools: { enabled: true },
|
||||
modules: ['@nuxtjs/tailwindcss', './modules/fix-tailwind-postcss'],
|
||||
app: {
|
||||
head: {
|
||||
titleTemplate: (titleChunk) => (titleChunk ? `${titleChunk} - 网宿软件` : '网宿软件'),
|
||||
meta: [
|
||||
{ charset: 'utf-8' },
|
||||
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
||||
{ name: 'robots', content: 'index,follow' }
|
||||
],
|
||||
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
|
||||
}
|
||||
},
|
||||
tailwindcss: {
|
||||
cssPath: '~/assets/css/tailwind.css',
|
||||
configPath: 'tailwind.config.cjs'
|
||||
},
|
||||
experimental: { appManifest: false },
|
||||
runtimeConfig: {
|
||||
public: {
|
||||
tenantId,
|
||||
serverApiBase,
|
||||
modulesApiBase,
|
||||
fileServerBase,
|
||||
templateId:
|
||||
process.env.NUXT_PUBLIC_TEMPLATE_ID || tenantId,
|
||||
|
||||
// Backward-compatible names (existing code may rely on them)
|
||||
ServerApi: serverApiBase,
|
||||
ApiBase: modulesApiBase,
|
||||
TenantId: tenantId
|
||||
}
|
||||
},
|
||||
css: ['ant-design-vue/dist/reset.css', '~/assets/css/tailwind.css'],
|
||||
vite: {
|
||||
server: {
|
||||
watch: {
|
||||
ignored: WATCH_IGNORED
|
||||
}
|
||||
}
|
||||
},
|
||||
nitro: {
|
||||
watchOptions: {
|
||||
ignored: WATCH_IGNORED
|
||||
}
|
||||
},
|
||||
watchers: {
|
||||
chokidar: {
|
||||
ignored: WATCH_IGNORED
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user