front/README_SIMPLEADMIN_API.md

51 lines
1.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.

# SimpleAdmin API 接口导入说明
## 当前状态
已准备好 SimpleAdmin API 的配置,但需要确认正确的 swagger.json 路径。
## 如何找到正确的 swagger.json 路径
1. **访问 Swagger UI 页面**
- 打开浏览器访问:`http://43.139.210.35:5566/index.html`
2. **查找 swagger.json 路径的方法:**
**方法一:查看页面源代码**
- 在 Swagger UI 页面按 `F12` 打开开发者工具
- 查看 `Network` 标签页
- 刷新页面,查找以 `swagger.json` 结尾的请求
- 记录完整的 URL 路径
**方法二:查看 Swagger UI 配置**
- 在页面源代码中搜索 `url:` 或 `swagger.json`
- 找到类似这样的配置:
```javascript
url: "/swagger/v1/swagger.json"
```
**方法三:尝试常见路径**
- 直接访问以下路径,看哪个能返回 JSON:
- `http://43.139.210.35:5566/swagger/v1/swagger.json`
- `http://43.139.210.35:5566/swagger.json`
- `http://43.139.210.35:5566/api/swagger.json`
3. **更新配置**
- 找到正确的路径后,编辑 `openapi2ts.config.ts` 文件
- 取消注释 SimpleAdmin 配置部分
- 将 `schemaPath` 更新为正确的路径
4. **生成接口文件**
```bash
npm run openapi2ts
```
## 生成的接口文件位置
接口文件将生成在:`src/api/SimpleAdmin/` 目录下
## 后续步骤
接口导入成功后,可以:
1. 参考 SimpleAdmin 项目的代码结构实现登录功能
2. 实现权限管理页面
3. 实现组织架构管理页面