ui 优化
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
schema_version: 1
|
||||
module_path: ""
|
||||
title: 音频设备 CMS 管理系统(前后端全栈)
|
||||
scope: []
|
||||
source_files: []
|
||||
depends_on: []
|
||||
related_to: []
|
||||
@@ -0,0 +1 @@
|
||||
前端:Vue 3.3 + Vite 6 + Element Plus 2.3(暗黑 CSS 变量 + 中文 locale)+ vue-router 4 + axios;后端:Express 4 + Sequelize 6 + mysql2 + JWT + Zod 校验 + AWS S3 SDK + Winston 日志 + ioredis;构建与编排:pnpm@11、Docker Compose、Nginx Alpine。
|
||||
@@ -0,0 +1,5 @@
|
||||
仓库为典型的前后端分离单仓结构:
|
||||
- `backend/src` 采用 Express 应用层 + Sequelize ORM 的数据访问层划分:`config/` 集中加载 `.env`、数据库、Redis、日志;`middleware/` 放置全局中间件(鉴权、bodyLimit);`models/` 通过 `index.js` 统一 `sync()` 并导出;`routes/` 按资源拆分路由文件并在 `routes/index.js` 聚合挂载;`services/` 封装外部依赖(S3、Curve、EQ 缓存、OTA 存储、用户引导);`validators/` 使用 zod 做入参校验;入口 `app.js` 在启动时执行 `sequelize.sync()` 与超级管理员引导。
|
||||
- `frontend/src` 基于 Vite + Vue3 + Element Plus,`main.js` 引入 Element Plus 暗黑 CSS 变量与自定义 `lux-theme.css`,`router/index.js` 声明式路由,`api/` 目录按资源一一对应后端 REST 接口,`views/` 按功能域组织页面组件,`components/` 存放跨页面复用组件。
|
||||
- 部署由根级 `docker-compose.yml` 编排:`backend` 容器暴露 8083,`frontend` 使用 nginx:alpine 静态托管 `dist` 并通过 `nginx.conf` 反向代理到后端,共享 `audio-network` 网络。
|
||||
- 顶层 `autoeq/` 存放测量数据 CSV/TXT 样本,`scripts/upload.sh` 用于上传脚本,`DEPLOY.md` / `DESIGN.md` 记录部署与设计说明。
|
||||
@@ -0,0 +1 @@
|
||||
基于 Vue3 + Element Plus 与 Express + Sequelize 的耳机品牌/型号、OTA 升级、黑名单与用户管理后台,提供 Glassmorphism 深色主题 UI。
|
||||
@@ -0,0 +1 @@
|
||||
开发:`cd frontend && pnpm dev` 启动 Vite 热更新;`cd backend && pnpm start` 或 `pnpm dev`(nodemon)。生产:`docker compose up -d --build`,需先复制 `.env.example` 为 `.env` 填写 DB/Redis/S3/JWT 等环境变量;前端构建产物位于 `frontend/dist`,由 nginx 容器以只读方式挂载。
|
||||
@@ -0,0 +1,5 @@
|
||||
- 前端样式集中在 `src/styles/lux-theme.css`,通过 `:root` CSS 变量定义色板、模糊半径、阴影层级,所有组件覆盖均以 `.lux-shell .el-*` 选择器限定作用域,不修改业务逻辑代码。
|
||||
- 后端路由按资源拆分为独立文件(如 `brands.js`、`models.js`、`ota.js`),在 `routes/index.js` 中统一遍历注册,新资源只需新增路由文件并加入数组即可生效。
|
||||
- 模型定义遵循 Sequelize 标准模式,并在 `models/index.js` 中集中 `sync({ force: false })`,避免在各路由中重复初始化连接。
|
||||
- 请求参数校验统一放在 `validators/` 目录下对应模块,使用 zod schema 描述后在路由 handler 中调用,保持路由层仅负责编排。
|
||||
- 前端 API 调用集中在 `src/api/` 下与后端资源一一对应的 JS 文件中,组件侧仅 import 函数而不直接写 axios 请求。
|
||||
Reference in New Issue
Block a user