finai/frontend/README.md

52 lines
1.5 KiB
Markdown
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.

# 财务大模型智能问答客服系统前端
本目录包含两套实现:
- `app/`:原零构建 HTML + 原生 JS 版本,保留作为快速演示和参考。
- 当前目录Vite + Vue 3长期演进版本便于扩展更多模块。
## Vite + Vue 3 版本
### 启动
```bash
cd code/frontend
npm install
npm run dev
```
默认监听 `http://127.0.0.1:5173`
后端按原方式启动:
```bash
cd code/backend
python -m uvicorn app.main:app --reload --host 127.0.0.1 --port 8000
```
### 目录结构
```
code/frontend/
├── app/ # 旧版零构建实现(保留)
├── index.html # Vite 入口
├── package.json
├── vite.config.js
└── src/
├── main.js
├── App.vue
├── router/ # vue-router 路由表
├── stores/ # Pinia 全局状态apiBase / token / 健康检查)
├── api/ # fetch 封装
├── components/ # Sidebar / Topbar / LoginPanel / Toast
├── views/ # ChatView / DocumentsView / AuditView占位待迁移
└── styles/main.css # 待从 app/style.css 迁移
```
### 迁移建议
1.`app/style.css` 整体合入 `src/styles/main.css`,确认视觉一致。
2. 按视图把 `app/app.js` 中的请求、SSE、列表渲染逻辑挪入对应 `views/*.vue`
3. 共用逻辑(如 SSE 解析、文档上传)提取到 `src/composables/`
4. 视图稳定后即可删除 `app/`,或保留作为静态降级方案。