添加 uipro,更新 wiki

This commit is contained in:
eafonyang
2026-07-10 11:25:45 +08:00
parent 6bb39e9172
commit f88ff46427
163 changed files with 30244 additions and 151 deletions
@@ -0,0 +1,7 @@
schema_version: 1
module_path: ""
title: 音频设备管理仪表盘(前后端单体仓库)
scope: []
source_files: []
depends_on: []
related_to: []
@@ -0,0 +1 @@
后端:Express 4 + Sequelize 6 + mysql2 + jsonwebtoken + multer + @aws-sdk/client-s3 + winston + ioredis + zod;前端:Vue 3 + vue-router 4 + Element Plus(含 dark css-vars+ vite 6 + axios;部署:Docker Composebackend 镜像自 buildfrontend 使用 nginx:alpine 静态托管)。
@@ -0,0 +1,5 @@
仓库采用前后端分离的单体结构:
- `backend/src` 为 Express API 服务,入口 `app.js` 统一挂载 CORS、JSON 解析、`bodyLimit` 中间件,并通过 `routes/index.js` 聚合 auth/brands/models/ota/blacklist/otaTargetDevice/shareCodeLogs/users/dashboard 等路由;数据层使用 Sequelize + mysql2,模型集中在 `models/` 并导出到 `models/index.js`;外部依赖通过 `services/` 抽象(curveClient 调用第三方曲线服务、eqCacheStorage/squiglink 处理 EQ 缓存、measurementStorage/otaStorage 对接 S3、userBootstrap 负责超级管理员初始化);鉴权由 `middleware/auth.js` + `utils/jwt.js` 实现。
- `frontend/src` 为 Vite + Vue3 + Element Plus SPA`router/index.js` 集中声明所有页面路由并在 `beforeEach` 中做 token 校验与超级管理员权限拦截;`api/` 下每个文件对应一个后端模块的 axios 封装;`views/` 按功能域分目录组织页面,`components/` 存放全局复用组件(ChangePasswordDialog、SidebarLogo、TabsView),`layout/index.vue` 提供侧边栏+标签页布局。
- 顶层 `docker-compose.yml` 编排 backendNode)与 frontendnginx:alpine 静态托管 dist),共享 `audio-network` 网络;`.env.example` 提供环境变量模板。
- 依赖方向单向:前端 → 后端 REST API,后端 → MySQL/S3/Redis/第三方 curve 服务,无跨包反向引用。
@@ -0,0 +1 @@
基于 Vue3 + Express/Sequelize 的耳机品牌、型号、OTA 与用户管理后台,提供曲线上传、S3 存储与 Element Plus 驱动的 Web 界面。
@@ -0,0 +1 @@
开发:`pnpm install` 后分别进入 `backend``frontend` 执行 `pnpm dev`;生产:`cd frontend && pnpm build` 生成 `dist/`,再 `docker compose up -d --build` 启动双容器,需提前准备 `.env`(参考 `.env.example`)并挂载 `/data/projects/source` 供 S3 本地模拟访问。
@@ -0,0 +1,5 @@
- 后端路由以独立文件暴露 express router,再由 `routes/index.js` 统一收集注册,避免在 app.js 内散写 use()。
- Sequelize 模型按领域单文件定义(Brand/Model/Ota/BlackList 等),并通过 `models/index.js` 集中 re-export 给 routes/services 使用。
- 前端路由采用懒加载 `() => import('@/views/...')` 形式,meta 字段声明 title/icon/requiresAuth/requiresSuperAdmin 控制导航与守卫。
- 前端 API 调用按业务域拆分到 `src/api/*.js`,每个文件对应一个后端路由模块,统一通过 `axios` 实例发起请求。
- 前端页面按功能域在 `views/<domain>/index.vue` 下组织,复杂页面内部再拆 `components/``composables/` 子目录。