Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,10 @@ CESIUM_ION_TOKEN=your_cesium_ion_token_here
# UMI_APP_API_BASE=https://api.example.com


# 可选:高德 Web 端(JS API)Key 与安全密钥(https://console.amap.com 申请)。
# 不配置时高德演示页使用组件库自带的公共 key(配额不受控),正式部署建议配置自己的
# AMAP_KEY=
# AMAP_SECURITY_CODE=

# 可选:Clarity 统计项目 ID(模板默认不含任何统计脚本,配置后按你自己的项目上报)
# CLARITY_ID=
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ jobs:
- name: Quality gates(typecheck + 严格 lint + vitest,含 mock 可加载性)
run: pnpm check

- name: Dependency audit(非阻断观察期)
# 两段式策略(决策 D7/D30):先建立可见性,high 存量清零后转强制阻断
run: pnpm audit --registry=https://registry.npmjs.org/ || true
- name: Dependency audit(high 及以上阻断;moderate/low 登记接受,见 THIRD-PARTY-NOTICES)
# 观察期结束:less 4.9.1 override 后 high 存量已清零(2026-09-22),转为强制阻断
run: pnpm audit --prod --audit-level=high --registry=https://registry.npmjs.org/

build:
needs: check
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ pnpm start
| --- | --- | --- |
| `CESIUM_ION_TOKEN` | Cesium 功能需要 | 在 [ion.cesium.com](https://ion.cesium.com/tokens) 获取;缺失时 Cesium Ion 影像/地形不可用(其余功能不受影响) |
| `UMI_APP_API_BASE` | 可选 | 真实后端 API 地址;不配置时开发环境走 umi mock、纯静态部署走内置静态演示数据(表格 CRUD 经 localStorage 持久化) |
| `AMAP_KEY` / `AMAP_SECURITY_CODE` | 可选 | 高德 Web 端(JS API)Key 与安全密钥([控制台申请](https://console.amap.com));不配置时高德演示页使用组件库自带公共 key(配额不受控),正式部署建议配置 |
| `CLARITY_ID` | 可选 | [Clarity](https://clarity.microsoft.com) 统计项目 ID;**模板默认不含任何统计脚本**,配置后才按你自己的项目上报(含会话回放,正式站点请履行隐私告知义务) |

## 常用脚本
Expand Down
8 changes: 6 additions & 2 deletions THIRD-PARTY-NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@

## 已知接受风险

以下依赖公告在写作时尚无补丁版本可用,作为已知接受风险登记(随上游发布补丁后升级消解):
依赖审计策略(2026-09-22 起):CI 以 `pnpm audit --prod --audit-level=high` 阻断 high 及以上;以下 moderate/low 公告经评估登记接受:

- `image-size`(high):仅构建链使用,不进入运行产物。
- `image-size`(high,**已消解**):仅构建链使用。已通过 `"less@<4.9.1": "4.9.1"` override 升级 less(4.9.1 起改用 probe-image-size)消除。
- `react-router@6.30.4` ×2(moderate):反斜杠 open redirect 与 SSR hydration 注入。6.x 无补丁(修复在 7.18.0),受 @umijs/max 4 约束无法升级;本项目所有路由跳转目标均为代码常量、纯 SPA 无 SSR,实际不可利用。umi 升级 5/react-router 7 时一并闭环。
- `uuid@8.3.2`(moderate):exceljs 传递依赖,仅 v3/v5/v6 且调用方传自定义 buffer 才触发,exceljs 内部只用 v4,不受影响。
- `decode-uri-component@0.2.2`(moderate):@umijs/history 传递依赖,畸形 percent-encoding 的 DoS,需超长构造串,风险低。
- `postcss-selector-parser` / `elliptic`(low):构建链与 webpack polyfill 链,无补丁或无运行时暴露。
2 changes: 2 additions & 0 deletions config/config.github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export default defineConfig({
CESIUM_ION_TOKEN: process.env.CESIUM_ION_TOKEN,
PUBLIC_PATH: '/umi-react-admin/',
UMI_APP_API_BASE: process.env.UMI_APP_API_BASE,
AMAP_KEY: process.env.AMAP_KEY,
AMAP_SECURITY_CODE: process.env.AMAP_SECURITY_CODE,
},
// umi 对 metas 数组为整体覆盖(不与 config.ts 逐项合并),viewport 需一并带上。
// meta CSP(审计 2026-09-22 H-3):GitHub Pages 无法自定义响应头,只能走 meta;
Expand Down
4 changes: 4 additions & 0 deletions config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ export default defineConfig({
// 以下变量经 define 显式注入(umi 仅自动注入 UMI_APP_* 前缀,未显式声明的
// process.env.X 会原样进入浏览器包并在模块初始化时抛 ReferenceError)
UMI_APP_API_BASE: process.env.UMI_APP_API_BASE,
// 高德 Web 端(JS API)Key 与安全密钥(审计 2026-09-22 M-6):
// 可选——不配置时高德页面回落 @pansy/amap-api-loader 自带的公共 key(配额不受本项目控制)
AMAP_KEY: process.env.AMAP_KEY,
AMAP_SECURITY_CODE: process.env.AMAP_SECURITY_CODE,
},
// 覆盖 umi 默认的 viewport(user-scalable=no / maximum-scale=1 禁止缩放,违反 WCAG 1.4.4)
metas: [{ name: 'viewport', content: 'width=device-width, initial-scale=1' }],
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"cesium-navigation-es6": "^3.0.9",
"d3": "^7.9.0",
"dayjs": "^1.11.11",
"dompurify": "^3.4.15",
"exceljs": "^4.4.0",
"html2canvas": "^1.4.1",
"ol": "^9.2.2",
Expand Down Expand Up @@ -121,6 +122,7 @@
"send@<0.19.0": "0.19.2",
"webpack@<5.104.1": "5.104.1",
"yaml@<1.10.3": "1.10.3",
"yaml@>=2.0.0 <2.8.3": "2.8.3",
"react-router@>=6.0.0 <6.30.4": "6.30.4",
"@remix-run/router@<1.23.3": "1.23.3",
"brace-expansion@>=1.0.0 <1.1.21": "1.1.21",
Expand All @@ -143,8 +145,10 @@
"baseline-browser-mapping@<2.11.0": "2.11.0",
"@babel/core@<7.29.6": "7.29.6",
"body-parser@>=1.20.0 <1.20.6": "1.20.6",
"hono@>=4.0.0 <4.12.34": "4.12.34",
"tmp@<0.2.6": "0.2.7"
"hono@>=4.0.0 <4.13.5": "4.13.5",
"tmp@<0.2.6": "0.2.7",
"@hono/node-server@<1.19.15": "1.19.15",
"less@<4.9.1": "4.9.1"
}
}
}
Loading
Loading