Files
fangke/admin/README-dev.md
T
浅念 f11abbff43 fix(admin): 微收口(注释/角色防御/dev 约定文档/husky 移除)
- routesAlias.ts 修复 clean:dev 打坏的块注释
- system-manage.ts menus/simple 标注死代码(backend 模式前置条件)
- /me 映射非 staff roles 兜底 R_USER,防空数组跳过菜单角色过滤
- 新增 README-dev.md:config-object 签名/URL 无 /api 前缀/Bearer 归映射层/v-html 红线
- package.json 删 husky prepare(防 pnpm install 改写 core.hooksPath)

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-15 17:39:50 +08:00

9 lines
828 B
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.
# admin 开发约定(Task 18-21 执行者必读)
基于 art-design-pro 模板的请求层适配约定,写业务前先读完本文件。
1. **request 是 config-object 签名**:`request.get<T>({ url, params })`,不是 axios 原生 `(url, config)`。
2. **URL 不带 `/api` 前缀**:`VITE_API_URL=/api` 已作为 baseURL,写 `/admin/auth/me` 即请求 `/api/admin/auth/me`;带 `/api` 会变成 `/api/api/...`。
3. **Bearer 不用业务层拼**:token 映射层已存 `Bearer <access>`,拦截器原样设置 Authorization;业务代码只管调 `request.*`。
4. **v-html 红线**:业务代码(`src/views/tracker/**`、`src/api/**`)禁用 v-html;也不得向模板内置 v-html 组件(ArtTextScroll / ThemeSvg / v-highlight)传访客来源数据(UTM、referrer、UA 等用户可控字段)。