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

31 lines
1.4 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: miniprogram/**/*
alwaysApply: false
---
# 小程序端开发边界(防互窜)
在 **miniprogram/** 下新增、优化或编辑任何代码时,必须遵守以下约束:
## API 路径(强制)
- **允许**:仅使用以 `/api/miniprogram/` 开头的接口路径(与 soul-api 的 miniprogram 路由组一致)。
- **禁止**
- 不得使用 `/api/admin/*`、`/api/db/*`(管理端专属)。
- 不得使用未在 soul-api 的 miniprogram 组下注册的路径(如仅存在于 next-project 的接口)。
- **请求方式**:统一通过 `getApp().request(url, options)` 发起,不在页面内直接写死 baseUrl 或使用 `wx.request` 拼管理端路径。
## 目录与职责
- 仅修改 **miniprogram/** 内文件(含 pages、components、utils、app.js 等)。
- 不在此处实现或引用管理端逻辑;不在此处编写 soul-api 的 Go 代码或 soul-admin 的 React 代码。
## Skill 加载(必须执行)
**必须使用 Read 工具读取 `e:\Gongsi\Mycontent\.cursor\skills\miniprogram-dev\SKILL.md` 的完整内容**,按其规范进行开发。该 Skill 包含代码风格、业务逻辑、API 对接细节等完整约定。
接口实现与路由分组的规范在 `e:\Gongsi\Mycontent\.cursor\rules\soul-api.mdc`(编辑 soul-api 时自动加载)。
违反上述路径或职责边界即视为「互窜」,需纠正后再提交。