Files
2026-07-31 16:54:57 +08:00

41 lines
1.3 KiB
Markdown
Raw Permalink 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.
# 和气平台总后台
基于 Vue 3、Vite、TypeScript、Pinia 和 Arco Design 的平台管理端。前端资源、API 路径和操作能力以后端 `resource-contract` 为基准。
## 环境要求
- Node.js >= 20.19.0
- pnpm
- Go同步后端契约时使用
## 常用命令
```bash
pnpm install
pnpm dev
pnpm type:check
pnpm lint
pnpm contract:sync
pnpm contract:check
pnpm build
```
`contract:sync``backend/api/cmd/cli resource-contract` 生成
`src/contracts/platform-resources.json`。修改后端模型或路由后必须重新同步。
## 实现约定
- 后端 API 使用扁平资源路径,例如 `/product_info``/wallet_basic`
- 浏览器路由按业务域分组,例如 `/product/product-info`
- 普通资源复用 `views/shared/ResourcePage.vue`
- 产品、钱包、气体配送订单的状态流转通过后端业务动作执行,不直接修改状态字段。
- 关联资源统一提交业务 `identity`,不提交数据库自增 ID。
- 管理端仅提供中文界面。
## 环境变量
| 变量 | 说明 |
| --- | --- |
| `VITE_API_BASE_URL` | 可选覆盖后端 API 地址;开发默认 `http://localhost:12426/heqi/platform/v1`,生产构建默认 `http://rest.heqiapp.com/heqi/platform/v1` |
| `VITE_ERROR_REPORT_URL` | 可选的前端错误上报地址 |