Files
soul-yongping/.cursor/rules/soul-admin-boundary.mdc

33 lines
1.6 KiB
Plaintext
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.

---
description: 管理端边界约束,防止与小程序/API 路径互窜
globs: soul-admin/**/*
alwaysApply: false
---
# 管理端开发边界(防互窜)
在 **soul-admin/** 下新增、优化或编辑任何代码时,必须遵守以下约束:
## API 路径(强制)
- **允许**:仅使用 soul-api 中面向管理端的路径,例如:
- `/api/admin`、`/api/admin/logout`、`/api/admin/withdrawals`、`/api/admin/chapters`、`/api/admin/content`、`/api/admin/settings` 等;
- `/api/db/users`、`/api/db/config/full`、`/api/db/chapters` 等;
- `/api/orders` 等与现网一致的管理端接口。
- **禁止**
- 不得调用 `/api/miniprogram/*`(小程序专属,如 miniprogram/login、miniprogram/book、miniprogram/withdraw 等)。
- 不得在管理端实现「使用小程序登录或小程序 token」的业务逻辑。
- **请求方式**:统一通过 `src/api/client.ts` 的 `get`、`post`、`put`、`del`、`request`;鉴权使用 `src/api/auth.ts` 的 admin_tokenBearer
## 目录与职责
- 仅修改 **soul-admin/** 内文件(含 src/pages、src/components、src/api、src/layouts 等)。
- 不在此处实现小程序逻辑;不在此处编写 soul-api 的 Go 代码或 miniprogram 的 WXML/WXSS/JS。
## 参考
- 代码风格、业务逻辑与 API 对接细节见 **.cursor/skills/SKILL-管理端开发.md**。
- 接口实现与路由分组见 soul-api 的 `.cursor/rules/soul-api-coding.mdc` 与 **.cursor/skills/SKILL-API开发.md**。
违反上述路径或职责边界即视为「互窜」,需纠正后再提交。