@lark-apaas/coding-templates 0.1.22 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/coding-templates",
3
- "version": "0.1.22",
3
+ "version": "0.1.23",
4
4
  "description": "OpenClaw project templates for mclaw CLI",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -118,6 +118,10 @@ app.use("/api/posts", postsRouter);
118
118
 
119
119
  ### 3. client/ — API 封装和页面
120
120
 
121
+ > ⚠️ **客户端所有 HTTP 请求必须使用 `axiosForBackend`**
122
+ >
123
+ > `axiosForBackend` 由 `@lark-apaas/client-toolkit-lite` 提供,内置平台鉴权和请求上下文。**禁止使用** `fetch`、`axios`、`XMLHttpRequest` 或其他 HTTP 客户端直接发起请求。
124
+
121
125
  `client/src/api/index.ts` 增加封装:
122
126
 
123
127
  ```typescript
@@ -307,7 +311,7 @@ export default function DashboardPage() {
307
311
  | 页面拆分 | 页面文件只做骨架编排(无 state/effect/逻辑);每个 Section 自包含数据+状态+类型;兄弟 Section 间无互相 import;单文件 ≤150 行 |
308
312
  | 命名规范 | 页面目录 PascalCase,页面入口文件与目录同名(PascalCase),组件文件名 kebab-case,组件名 PascalCase |
309
313
  | 路由注册 | 默认 `HomePage` 已替换为业务首页;新页面已在 `app.tsx` 注册;跳转使用 `<Link>` / `useNavigate()`,无 `<a href>` |
310
- | API 调用 | 统一在 `api/` 封装;使用 `@shared` 类型;组件内不直接 fetch |
314
+ | API 调用 | 统一在 `api/` 封装;必须使用 `axiosForBackend` 发起请求,禁止 `fetch`/`axios`;使用 `@shared` 类型 |
311
315
  | 输入校验 | zod schema 定义在 `shared/api.interface.ts`;server 和 client 共用 |
312
316
  | 主题色 | 使用语义化变量类(`bg-background`、`text-primary` 等);未硬编码颜色值 |
313
317
  | 主题修改 | 仅增量覆盖变更的变量;新增色同时注册 `:root` 和 `@theme inline` |