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

34 lines
1.7 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。
## Skill 加载(必须执行)
**必须使用 Read 工具读取 `e:\Gongsi\Mycontent\.cursor\skills\admin-dev\SKILL.md` 的完整内容**,按其规范进行开发。该 Skill 包含代码风格、业务逻辑、API 对接细节等完整约定。
接口实现与路由分组的规范在 `e:\Gongsi\Mycontent\.cursor\rules\soul-api.mdc`(编辑 soul-api 时自动加载)。
违反上述路径或职责边界即视为「互窜」,需纠正后再提交。