feat(app): 添加多模板关于我们页面及相关路由和404页面

- 新增404页面,优化未找到页面体验,避免被搜索引擎索引
- 增加文件代理接口,隐藏真实文件服务器地址,支持文件请求代理
- 实现/article、/case、/product及/page动态路由兼容列表与详情展示
- 添加动态CMS页面兼容入口处理旧式路径,统一路由与SEO设置
- 新增模板1、模板7、模板2、模板3关于我们页面,实现多模板支持
- 模板增强支持CMS单页内容加载及SEO信息动态设置
- 配置环境变量及Git忽略文件规则辅助开发和构建环境管理
This commit is contained in:
2026-09-08 12:13:44 +08:00
commit 2b69686795
381 changed files with 59891 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
/**
* 文件 URL 处理
* 将后端返回的相对路径转为通过代理访问的 URL
*/
/** 文件代理基础路径 */
export function useFileUrl() {
const _config = useRuntimeConfig()
/**
* 将文件路径转为可访问的 URL
* - 完整 URLhttp/https)直接返回
* - 相对路径通过 /api/file/ 代理
*/
function fileUrl(path?: string | null): string {
if (!path) return ''
// 完整 URL 直接返回
if (path.startsWith('http://') || path.startsWith('https://')) {
return path
}
// 相对路径通过代理
const cleanPath = path.startsWith('/') ? path.slice(1) : path
return `/api/file/${cleanPath}`
}
return { fileUrl }
}