
《今日时事》 是一个综合性的新闻聚合平台,整合了来自社交媒体、科技资讯、金融市场和娱乐等多个热门源的信息。采用现代化的Web技术构建,为用户提供简洁、直观的界面,让您轻松掌握全球动态。
克隆仓库
git clone https://github.com/LYX9527/what-happen.git
cd what-happen
安装依赖
yarn install
# 或
npm install
环境配置
# 复制环境变量模板
cp .env.example .env
# 配置API端点(默认:http://localhost:10010)
VITE_API_BASE_URL=http://localhost:10010
启动开发服务器
yarn dev
# 或
npm run dev
打开浏览器
访问 http://localhost:5173
# 构建生产版本
yarn build
# 预览生产构建
yarn preview
本前端应用需要后端API服务运行在10010端口(可配置)。API应提供:
interface NewsItem {
id: string
title: string
url: string
extra?: {
info?: string
time?: string
rank?: number
thumbnail?: { url: string }
// ... 其他元数据
}
}
interface ApiResponse<T> {
code: number
msg: string
data: T
}
# API配置
VITE_API_BASE_URL=http://localhost:10010 # 后端API地址
编辑 app/pages/dashboard/index.vue 修改平台配置:
const platformIcons = {
weibo: WeiBo,
github: Github,
// 添加您的自定义平台
}
app/ ├── api/ # API接口和配置 ├── components/ # 可复用Vue组件 │ ├── ui/ # 基础UI组件 │ ├── NewsItems/ # 新闻项组件 │ └── icon/ # 平台图标组件 ├── composables/ # Vue组合式函数 ├── pages/ # 应用页面 ├── router/ # Vue Router配置 └── lib/ # 工具函数
app/components/icon/ 目录app/components/NewsItems/app/api/news.ts 中配置我们欢迎所有形式的贡献!请查看我们的贡献指南了解详情。
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)本项目采用MIT协议 - 查看LICENSE文件了解详情。
详细更新日志请查看 CHANGELOG.md
Made with ❤️ by the 《今日时事》 Team
保持知情,保持连接