# Ai-chat-frontend **Repository Path**: dxh_git/Ai-chat-frontend ## Basic Information - **Project Name**: Ai-chat-frontend - **Description**: AI聊天助手 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 6 - **Forks**: 0 - **Created**: 2025-09-12 - **Last Updated**: 2025-09-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # AI Chat 前端项目 这是一个基于 Vue 3 和 Vite 构建的 AI 聊天应用前端项目。 ## 配套后端 [后端项目][https://gitee.com/dxh_git/rag-agent.git) ## 技术栈 - [Vue 3](https://v3.vuejs.org/) - [Vite](https://vitejs.dev/) - [Axios](https://axios-http.com/) - [Element Plus](https://element-plus.org/) ## 推荐开发环境 [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (并禁用 Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) ## 项目结构 ``` src/ ├── api/ # API 接口封装 ├── assets/ # 静态资源 ├── components/ # 公共组件 ├── views/ # 页面视图 ├── router/ # 路由配置 ├── store/ # 状态管理 └── utils/ # 工具函数 ``` ## 演示图 ![img.png](img.png) ![img_1.png](img_1.png) ![img_2.png](img_2.png) ## 项目设置 ### 安装依赖 ```sh npm install ``` ### 开发环境编译和热重载 ```sh npm run dev ``` ### 生产环境编译和压缩 ```sh npm run build ``` ## 配置说明 ### 开发环境配置 项目使用 Vite 作为构建工具,配置文件位于 [vite.config.js]。默认配置包括: - 端口: 5173 - 自动打开浏览器 - API 代理配置 ### API 代理 开发环境下,所有 `/api` 开头的请求会被代理到 `http://127.0.0.1:8000`,以解决跨域问题。 ```javascript proxy: { '/api': { target: 'http://127.0.0.1:8000', changeOrigin: true, }, } ``` ## 自定义配置 参见 [Vite 配置参考](https://vitejs.dev/config/)。 ## 部署说明 构建后的文件位于 `dist/` 目录,可部署到任何静态文件服务器上。 ```sh npm run build ``` ## 注意事项 1. 确保后端服务运行在 `http://127.0.0.1:8000` 2. 开发环境下默认启用 source map 便于调试 3. 如需修改代理地址,请在 [vite.config.js]中调整 [proxy]配置