Files
zt-closet-manage-frontend/README.md
T
2026-09-11 01:46:36 +08:00

62 lines
2.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.
# zt-closet-manage-frontend
「纸条衣橱」管理后台前端系统,对接 [zt-closet-manage-backend](https://git.lzcwy.cn/zhengchiliu/zt-closet-manage-backend)(Go + Gin)提供的 `/api/v1` 接口。
## 技术栈
| 分类 | 技术 |
| --- | --- |
| 框架 | Vue 3(`<script setup lang="ts">`)+ TypeScript |
| 构建 | Vite |
| UI | Element Plus(全量引入,靛蓝主题定制) |
| 路由 | vue-router 4(全局守卫:登录态 + 超管权限) |
| 状态 | Pinia(auth store 持久化 token / 管理员信息) |
| HTTP | axios(Bearer 注入、业务码统一处理、11002 过期自动刷新重放) |
## 功能模块
- **登录与鉴权**:账号密码登录、JWT 双 token 自动刷新、登出、修改密码
- **仪表盘**:用户/订单/营收/待办统计聚合
- **用户管理**:分页搜索、详情(四类额度)、封禁/解封、额度/VIP 人工调整
- **商品管理**:新增/编辑/上下架/软删除
- **订单与退款**:订单列表与详情、退款审核(通过/驳回)
- **内容审核**:穿搭审核(通过/驳回/封禁)、衣物列表、衣柜分享封禁
- **通知推送**:单用户通知、全量广播
- **管理员管理**(超管专属):列表/创建/编辑/删除
## 快速开始
```sh
npm install
npm run dev # 开发(默认 http://localhost:5173)
npm run build # 类型检查 + 生产构建
```
开发环境下 `/api` 请求经 Vite 代理转发至 `http://localhost:8080`(后端默认端口),需先启动后端服务:
```bash
cd ../zt-closet-manage-backend && go run .
```
## 目录结构
```
src/
├── api/ # 接口封装(与后端 DTO 一一对应)
├── assets/ # 全局样式与 Element Plus 主题变量
├── components/ # 通用组件(筛选卡片、分页条)
├── layout/ # 后台布局(侧边栏、顶栏)
├── router/ # 路由表与全局守卫
├── stores/ # Pinia(auth)
├── types/ # 类型定义(对齐后端 json tag)
├── utils/ # request 封装、格式化、枚举映射
└── views/ # 业务页面(按模块懒加载)
```
## 约定
- 金额单位后端为「分」,前端统一按「元」展示与输入(提交时乘 100 取整)
- 时间戳为 Unix 秒,统一格式化为 `YYYY-MM-DD HH:mm:ss`
- 业务结果以响应体 `code` 为准(多数业务错误 HTTP 仍为 200)
- access token 过期(业务码 11002)时自动用 refresh token 换取新 token 并重放原请求