feat: 新增web配置中心

This commit is contained in:
2026-04-23 17:25:37 +08:00
parent cab53e7947
commit 8d20792fc3
7 changed files with 650 additions and 7 deletions
+14
View File
@@ -95,7 +95,21 @@ npm run typecheck
| 方法 | 路径 | 说明 |
| --- | --- | --- |
| `GET` | `http://localhost:<proxyPort>/__config` | 查看当前路由与配置 |
| `POST` | `http://localhost:<proxyPort>/__config` | 保存 `config.json`(包含 `routes` 与 `config`) |
| `POST` | `http://localhost:<proxyPort>/__reload-config` | 手动重新加载 `config.json` |
| `POST` | `http://localhost:<proxyPort>/__routes` | 动态新增单个路由与 mock 文件 |
| `GET` | `http://localhost:<proxyPort>/__admin` | 配置管理页面(Element UI) |
#### `POST /__routes` 请求示例
```json
{
"route": "/api/new/mock",
"filePath": "mock/new-api.json",
"fileContent": "{\"code\":0,\"message\":\"ok\"}",
"overwrite": false
}
```
### TypeScript 与编译说明