mirror of
https://gitee.com/ShopeX/ECShopX_admin-frontend
synced 2026-08-10 14:26:04 +08:00
[TBID:ECX-9414] chore: merge master changes for release
This commit is contained in:
196
docs/security/dependabot-accept-list.md
Normal file
196
docs/security/dependabot-accept-list.md
Normal file
@@ -0,0 +1,196 @@
|
||||
# Dependabot 剩余告警整理与 Accept 操作指南
|
||||
|
||||
> 整理时间:2026-07-15
|
||||
> 扫描命令:`npm audit --registry=https://registry.npmjs.org`
|
||||
> Dependabot 入口:https://github.com/ShopeX/ECShopX_admin-frontend/security/dependabot
|
||||
> 关联文档:[fix-plan.md](./fix-plan.md) · [dependabot-remediation.md](../security-dependabot-remediation.md)
|
||||
|
||||
---
|
||||
|
||||
## 一、修复成果总览
|
||||
|
||||
| 阶段 | 漏洞总数 | Critical | High | 主要动作 |
|
||||
|------|----------|----------|------|----------|
|
||||
| 基线(修复前) | 174 | 34 | 77 | — |
|
||||
| PR-1~3b(修复后) | **61** | **0** | 25 | 见下表 |
|
||||
| **降幅** | **↓ 65%** | **↓ 100%** | **↓ 68%** | — |
|
||||
|
||||
### 已完成的修复(代码已改)
|
||||
|
||||
| 类别 | 动作 |
|
||||
|------|------|
|
||||
| 删除无用包 | `babel-preset-env`、`big`、`qiniu-webpack-plugin`、`node-sass-js-importer` |
|
||||
| 运行时升级 | `axios@1.8.0`、`qs@6.14.0`、`lodash-es@4.17.23`、`nanoid@3.3.8` |
|
||||
| SDK 升级 | `@antv/g2plot`、`cos-js-sdk-v5` |
|
||||
| 构建脚本 | `xlsx` → `exceljs`(`build/update_i18n_from_excel.js`) |
|
||||
| 开发工具 | `prettier-eslint-cli@8.0.1` |
|
||||
| overrides | `fast-xml-parser`、`follow-redirects`、`lodash`、`semver` |
|
||||
| 业务兼容 | PC 装修页 nanoid API 适配(`src/utils/nanoidAlphabet.js`) |
|
||||
| 配置清理 | `vue.config.js` 移除 `qiniu-webpack-plugin` |
|
||||
|
||||
**构建验证**:`npm run build:b2c` ✅ · `npm run build:bbc` ✅
|
||||
|
||||
---
|
||||
|
||||
## 二、剩余 61 项处理策略
|
||||
|
||||
```
|
||||
61 项
|
||||
├── A. 建议 Accept(约 48 项)— 无补丁 / 仅 dev·构建 / 不进入生产包
|
||||
├── B. 暂不处理(约 10 项)— 需大版本升级,单独立项
|
||||
└── C. 禁止 force fix — 会破坏 Vue CLI 5 构建
|
||||
```
|
||||
|
||||
**结论:安全修复工作已收尾,剩余项在 Dependabot 批量 Accept 即可。**
|
||||
|
||||
---
|
||||
|
||||
## 三、Dependabot Accept 清单(按类别)
|
||||
|
||||
在 GitHub → Security → Dependabot alerts → 选中告警 → **Dismiss alert** → 选 **Accept risk**,粘贴对应备注。
|
||||
|
||||
### 统一备注模板(可复制)
|
||||
|
||||
```
|
||||
已评估:该告警属于 Vue 2 EOL / 仅开发构建依赖 / 无可用非破坏性修复。
|
||||
已于 2026-07-15 完成依赖安全整治(Critical 清零,见 docs/security/fix-plan.md)。
|
||||
计划 Vue 3 迁移或专项 PR 处理,当前不执行 npm audit fix --force。
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### A1. Vue 2 生态 — 无官方补丁(10 项)✅ Accept
|
||||
|
||||
| 包 | 级别 | Accept 原因 |
|
||||
|----|------|-------------|
|
||||
| `vue` | Low | Vue 2 已 EOL,ReDoS 无补丁,根治需 Vue 3 |
|
||||
| `element-ui` | Low | 依赖 vue@2,无安全更新 |
|
||||
| `vuex` | Low | 依赖 vue@2 |
|
||||
| `@icon-park/vue` | Low | 连带 vue |
|
||||
| `lucide-vue` | Low | 连带 vue |
|
||||
| `@riophae/vue-treeselect` | Low | 连带 vue |
|
||||
| `@shopex-ui/finder` | Low | 连带 element-ui |
|
||||
| `vue-advanced-cropper` | Low | 连带 vue |
|
||||
| `vue-template-compiler` | Moderate | 仅 `npm run build` 编译期;不编译不可信模板 |
|
||||
| `vue-loader` | Moderate | Vue CLI 构建链,不进入运行时 |
|
||||
|
||||
---
|
||||
|
||||
### A2. 构建工具链 — 不进入生产包(约 28 项)✅ Accept
|
||||
|
||||
> 以下包仅存在于 `devDependencies` 或构建传递依赖,**不会打入 `dist/`**。
|
||||
|
||||
| 包 | 级别 | 说明 |
|
||||
|----|------|------|
|
||||
| `sass-loader` | High | 传递依赖 `node-sass` 链;项目实际用 dart `sass`,升级需专项 PR |
|
||||
| `node-sass` | High | 构建链遗留,非运行时 |
|
||||
| `node-gyp` | High | node-sass 传递 |
|
||||
| `tar` / `cacache` | High | node-gyp 传递 |
|
||||
| `make-fetch-happen` | High | node-gyp 传递 |
|
||||
| `@tootallnate/once` | Low | node-gyp 传递 |
|
||||
| `http-proxy-agent` | Low | node-gyp 传递 |
|
||||
| `gaze` / `globule` | High | node-sass 传递 |
|
||||
| `svg-sprite-loader` | Moderate | SVG 图标构建 |
|
||||
| `svg-baker` / `svg-baker-runtime` | Moderate | svg-sprite-loader 传递 |
|
||||
| `braces` / `micromatch` | High | svg-baker 传递 |
|
||||
| `@vue/cli-service` | Moderate | Vue CLI 5 核心 |
|
||||
| `@vue/cli-plugin-babel` | Moderate | Vue CLI 插件 |
|
||||
| `@vue/cli-plugin-eslint` | High | Vue CLI 插件 |
|
||||
| `@vue/cli-plugin-router` | Moderate | Vue CLI 插件 |
|
||||
| `@vue/cli-plugin-vuex` | Moderate | Vue CLI 插件 |
|
||||
| `@vue/component-compiler-utils` | Moderate | vue-loader 传递 |
|
||||
| `compression-webpack-plugin` | Moderate | 生产构建压缩 |
|
||||
| `copy-webpack-plugin` | Moderate | 构建复制 |
|
||||
| `css-minimizer-webpack-plugin` | Moderate | CSS 压缩 |
|
||||
| `image-minimizer-webpack-plugin` | Moderate | 图片压缩 |
|
||||
| `serialize-javascript` | High | webpack 插件传递 |
|
||||
| `webpack-dev-server` | Moderate | 仅 `npm run dev` |
|
||||
| `sockjs` | Moderate | dev-server 传递 |
|
||||
| `postcss` | Moderate | 旧版传递(@vue/component-compiler-utils) |
|
||||
| `cross-spawn` / `execa` / `yorkie` | High | @vue/cli-plugin-eslint → git hooks |
|
||||
| `minimatch` / `glob` | High | 构建工具传递 |
|
||||
|
||||
---
|
||||
|
||||
### A3. 开发 / 提交工具 — 不进生产(约 6 项)✅ Accept
|
||||
|
||||
| 包 | 级别 | 说明 |
|
||||
|----|------|------|
|
||||
| `cz-customizable` | Low | commitizen 交互,仅本地 |
|
||||
| `inquirer` / `external-editor` / `tmp` | Low/High | cz-customizable / commit 工具传递 |
|
||||
| `prettier-eslint` | High | 已升 cli@8;顶层 dev 工具 |
|
||||
| `prettier-eslint-cli` | High | 已升 8.0.1;audit 仍可能报嵌套 |
|
||||
| `@typescript-eslint/parser` | High | prettier-eslint 传递,仅 lint |
|
||||
| `@typescript-eslint/typescript-estree` | High | 同上 |
|
||||
|
||||
---
|
||||
|
||||
### A4. 图表 / 视频 — 已升或影响面小(约 4 项)✅ Accept
|
||||
|
||||
| 包 | 级别 | 说明 |
|
||||
|----|------|------|
|
||||
| `@antv/g2plot` | High | 已升到 2.4.35;rollup 传递无非破坏性修复 |
|
||||
| `fmin` / `rollup` | High | g2plot 传递 |
|
||||
| `exceljs` | Moderate | 仅 `build/update_i18n_from_excel.js` 开发脚本 |
|
||||
|
||||
---
|
||||
|
||||
### B. 暂不 Accept — 建议单独立项(可选后续)
|
||||
|
||||
| 包 | 级别 | 后续方案 | 优先级 |
|
||||
|----|------|----------|--------|
|
||||
| `vue-video-player` | Moderate | 换播放器或升 video.js 7+ | 低(仅视频页) |
|
||||
| `video.js` | Moderate | 同上 | 低 |
|
||||
| `videojs-contrib-hls` | Moderate | 同上 | 低 |
|
||||
| `videojs-contrib-media-sources` | Moderate | 同上 | 低 |
|
||||
| `uuid` | Moderate | sockjs 传递,仅 dev-server | 低 |
|
||||
|
||||
---
|
||||
|
||||
## 四、Dependabot 批量操作步骤
|
||||
|
||||
1. 打开 https://github.com/ShopeX/ECShopX_admin-frontend/security/dependabot
|
||||
2. 筛选 **Open** 告警
|
||||
3. 对 **A1~A4** 类别逐条或批量 **Dismiss → Accept risk**
|
||||
4. 备注粘贴 [§三 统一备注模板](#统一备注模板可复制)
|
||||
5. **不要** 点击 Dependabot 自动生成的 PR(多数会 `--force` 降级 Vue CLI)
|
||||
6. 处理完成后在 [fix-plan.md §六](./fix-plan.md) 将 PR-4 标为 ✅
|
||||
|
||||
---
|
||||
|
||||
## 五、上线前业务回归清单
|
||||
|
||||
依赖升级后,建议在测试环境过一遍:
|
||||
|
||||
- [ ] 登录 / 登出 / Token 过期刷新(`axios@1.8`)
|
||||
- [ ] 列表筛选、分页、带数组参数的 query(`qs@6.14`)
|
||||
- [ ] 文件上传:阿里云 OSS / 腾讯云 COS(`cos-js-sdk-v5`)
|
||||
- [ ] 文件导出 / 下载
|
||||
- [ ] Dashboard 图表(`@antv/g2plot`,3 个页面)
|
||||
- [ ] PC 首页 / 会员页 / 自定义页装修保存(`nanoid` 适配)
|
||||
- [ ] `npm run build:b2c` + `npm run build:bbc` 构建成功
|
||||
|
||||
---
|
||||
|
||||
## 六、禁止事项(再次强调)
|
||||
|
||||
| 操作 | 后果 |
|
||||
|------|------|
|
||||
| `npm audit fix --force` | Vue CLI 降到 3.x,构建失败 |
|
||||
| 一次性升 Vue 3 | 范围过大,应单独立项 |
|
||||
| 在 npmmirror 跑 audit | 不支持,结果不准 |
|
||||
|
||||
---
|
||||
|
||||
## 七、可选后续专项(非阻塞上线)
|
||||
|
||||
| 专项 | 预期收益 | 工期 |
|
||||
|------|----------|------|
|
||||
| `sass-loader` 13+ 升级 | 消 node-sass 链 5~8 High | 1~2 天 |
|
||||
| SVG 图标方案替换 | 消 svg-sprite-loader 链 | 2~3 天 |
|
||||
| Vue 3 + Element Plus 迁移 | 根治 Vue 2 全部告警 | 数月 |
|
||||
| CI 加 `npm audit --audit-level=critical` | 防止 Critical 回退 | 0.5 天 |
|
||||
|
||||
---
|
||||
|
||||
*本文档随 `npm audit` 结果更新;下次大版本依赖变更后重新扫描并修订 §三 清单。*
|
||||
324
docs/security/fix-plan.md
Normal file
324
docs/security/fix-plan.md
Normal file
@@ -0,0 +1,324 @@
|
||||
# 依赖漏洞修复执行方案
|
||||
|
||||
> 制定时间:2026-07-15
|
||||
> 基线扫描:`npm audit --registry=https://registry.npmjs.org` → **174 项**(Critical 34 / High 77 / Moderate 42 / Low 21)
|
||||
> 关联文档:[dependabot-remediation.md](./dependabot-remediation.md)
|
||||
> Dependabot:https://github.com/ShopeX/ECShopX_admin-frontend/security/dependabot
|
||||
|
||||
---
|
||||
|
||||
## 一、修复目标
|
||||
|
||||
| 阶段 | 目标 | 预计剩余告警 | 工期 |
|
||||
|------|------|--------------|------|
|
||||
| PR-1 清理 | 删除无用依赖 + audit fix | ~120 项 | 0.5 天 |
|
||||
| PR-2 运行时升级 | axios / qs / lodash-es 等 | ~90 项 | 2~3 天 |
|
||||
| PR-3 构建链 | sass-loader、xlsx 替换等 | ~70 项 | 2 天 |
|
||||
| PR-4 接受风险 | Vue 2 生态 Document | ~50 项(长期) | 持续 |
|
||||
|
||||
**本方案目标**:3 个 PR 内将 **Critical 清零、High 降至 30 以下**;Vue 2 相关 Low 暂 Accept。
|
||||
|
||||
---
|
||||
|
||||
## 二、PR-1:零风险清理(优先合并)
|
||||
|
||||
### 2.1 删除未使用 / 误装依赖
|
||||
|
||||
经全仓检索,以下包 **无任何业务引用**,删除不影响构建与运行:
|
||||
|
||||
| 包 | 类型 | 删除理由 |
|
||||
|----|------|----------|
|
||||
| `babel-preset-env` | dev | Babel 6 遗留;`babel.config.js` 已用 Babel 7 |
|
||||
| `big` | prod | 误装 HTTP 框架;业务用的是 `big.js`(传递依赖) |
|
||||
| `qiniu-webpack-plugin` | prod | `vue.config.js` 仅 require 未使用;已有 `webpack-aliyun-oss` |
|
||||
| `node-sass-js-importer` | dev | 无引用;项目使用 `sass`(dart-sass) |
|
||||
|
||||
### 2.2 代码改动
|
||||
|
||||
**`vue.config.js`** — 删除第 2 行:
|
||||
|
||||
```diff
|
||||
- const QiniuPlugin = require('qiniu-webpack-plugin')
|
||||
```
|
||||
|
||||
### 2.3 执行命令
|
||||
|
||||
```bash
|
||||
npm uninstall babel-preset-env big qiniu-webpack-plugin node-sass-js-importer
|
||||
npm audit fix --registry=https://registry.npmjs.org
|
||||
npm run build:b2c
|
||||
npm run build:bbc
|
||||
```
|
||||
|
||||
### 2.4 验证
|
||||
|
||||
```bash
|
||||
npm audit --registry=https://registry.npmjs.org | tail -3
|
||||
# 记录剩余数量,更新本文档 §六 进度表
|
||||
```
|
||||
|
||||
### 2.5 预期效果
|
||||
|
||||
- 消除 `babel-preset-env` 整条 Babel 6 Critical 链(约 20+ 项)
|
||||
- 消除 `big` 带入的 express/morgan/request 等 Critical 链
|
||||
- 消除 `qiniu-webpack-plugin` 相关 High
|
||||
- `audit fix` 自动修复 webpack、yaml、semver 等传递依赖
|
||||
|
||||
**风险**:极低
|
||||
**建议 TB**:可单独开安全清理任务
|
||||
|
||||
---
|
||||
|
||||
## 三、PR-2:运行时依赖升级(需全量回归)
|
||||
|
||||
### 3.1 升级清单
|
||||
|
||||
| 包 | 当前 | 目标 | 级别 | 改动范围 |
|
||||
|----|------|------|------|----------|
|
||||
| `axios` | 0.19.2 | **1.8.0** | High | 全局 HTTP,重点见 §3.2 |
|
||||
| `qs` | ^6.4.0 | **^6.14.0** | High | 3 个文件 |
|
||||
| `lodash-es` | 4.17.21 | **4.17.23** | High | 传递 + 直接 |
|
||||
| `nanoid` | 2.1.8 | **3.3.8** | Moderate | API 兼容,检查调用方 |
|
||||
| `@antv/g2plot` | 2.4.31 | **2.4.35+** | High | 3 个图表页 |
|
||||
|
||||
### 3.2 axios 升级专项(风险最高)
|
||||
|
||||
**执行:**
|
||||
|
||||
```bash
|
||||
npm install axios@1.8.0
|
||||
```
|
||||
|
||||
**必查文件:**
|
||||
|
||||
```
|
||||
src/api/request/index.js # 主请求封装、拦截器、Token 刷新
|
||||
src/api/request/request.js
|
||||
src/utils/fetch.js # 旧封装
|
||||
src/utils/axiosJsonp.js
|
||||
src/api/req.js
|
||||
src/api/ossStorage.js
|
||||
```
|
||||
|
||||
**回归清单:**
|
||||
|
||||
- [ ] 登录 / 登出 / Token 过期刷新
|
||||
- [ ] 列表分页、筛选、导出
|
||||
- [ ] 文件上传(OSS / COS)
|
||||
- [ ] FormData / 文件下载
|
||||
- [ ] 错误提示(401 / 403 / 500)
|
||||
|
||||
**常见破坏性变化:**
|
||||
|
||||
- 错误对象结构细微差异 → 检查 `error.response` 判空
|
||||
- 默认 `Content-Type` 行为 → 上传接口重点测
|
||||
- 不再内置某些旧版 hack → 检查 `utils/fetch.js`
|
||||
|
||||
### 3.3 qs 升级
|
||||
|
||||
```bash
|
||||
npm install qs@6.14.0
|
||||
```
|
||||
|
||||
**文件:**
|
||||
|
||||
- `src/api/request/index.js`
|
||||
- `src/utils/fetch.js`
|
||||
- `src/api/shipping.js`
|
||||
|
||||
**回归:** 带复杂 query 的列表筛选、数组参数序列化。
|
||||
|
||||
### 3.4 其余小版本
|
||||
|
||||
```bash
|
||||
npm install lodash-es@4.17.23 nanoid@3.3.8
|
||||
npm install @antv/g2plot@latest # 锁定后检查 lock 版本 ≤ 当前大版本
|
||||
npm audit fix --registry=https://registry.npmjs.org
|
||||
```
|
||||
|
||||
**图表回归页:**
|
||||
|
||||
- `src/views/dashboard/index.vue`
|
||||
- `src/views/dashboard/merchant-dashboard.vue`
|
||||
- `src/view/mall/datacube/companydata/order.vue`
|
||||
|
||||
### 3.5 PR-2 验证命令
|
||||
|
||||
```bash
|
||||
npm run build:b2c && npm run build:bbc
|
||||
npm audit --registry=https://registry.npmjs.org --audit-level=high
|
||||
```
|
||||
|
||||
**风险**:中(axios 为主)
|
||||
**建议**:PR-2 仅含运行时 prod 依赖,不要混入 dev 构建链改动
|
||||
|
||||
---
|
||||
|
||||
## 四、PR-3:构建链与无修复包处理
|
||||
|
||||
### 4.1 xlsx → exceljs(推荐)
|
||||
|
||||
**现状**:`xlsx@0.18.5` High,社区版 **无 npm 修复**
|
||||
**使用处**:仅 `build/update_i18n_from_excel.js`
|
||||
|
||||
**方案:**
|
||||
|
||||
```bash
|
||||
npm uninstall xlsx
|
||||
npm install -D exceljs
|
||||
```
|
||||
|
||||
重写 `build/update_i18n_from_excel.js` 读写逻辑(仅开发脚本,不影响生产包体积若放 devDependencies)。
|
||||
|
||||
**替代**:若脚本使用频率极低,可改为手动维护 JSON,直接删除 xlsx。
|
||||
|
||||
### 4.2 sass 构建链
|
||||
|
||||
项目已用 `sass`(dart-sass),可升级 loader:
|
||||
|
||||
```bash
|
||||
npm install -D sass-loader@^13.3.0
|
||||
```
|
||||
|
||||
检查 `vue.config.js` 中 sass/scss `loaderOptions` 是否需适配。
|
||||
|
||||
**不要**再引入 `node-sass` / `node-sass-js-importer`(PR-1 已删)。
|
||||
|
||||
### 4.3 package.json overrides 扩展
|
||||
|
||||
PR-1、2 完成后若 High 仍多,追加:
|
||||
|
||||
```json
|
||||
"overrides": {
|
||||
"resource": "0.8.1",
|
||||
"xmlhttprequest": "1.8.0",
|
||||
"jugglingdb-nano": "0.0.1",
|
||||
"global": "2.0.1",
|
||||
"webpack": "^5.104.1",
|
||||
"ws": "^8.18.0",
|
||||
"semver": "^7.7.0",
|
||||
"lodash": "^4.17.23",
|
||||
"follow-redirects": "^1.15.9"
|
||||
}
|
||||
```
|
||||
|
||||
```bash
|
||||
rm -rf node_modules package-lock.json
|
||||
npm install
|
||||
npm run build:b2c
|
||||
```
|
||||
|
||||
> 全量重装 lock 影响面大,建议在 PR-3 单独做,便于回滚。
|
||||
|
||||
### 4.4 devDependencies 可选升级(非阻塞)
|
||||
|
||||
| 包 | 建议 | 说明 |
|
||||
|----|------|------|
|
||||
| `postcss` | ^8.5.6 | audit fix 或手动 |
|
||||
| `svgo` | 最新 3.x | 构建 svg 优化 |
|
||||
| `prettier-eslint-cli` | ^8.0.1 或移除 | 仅本地 lint |
|
||||
| `compression-webpack-plugin` 等 | audit fix | 随 lock 更新 |
|
||||
|
||||
### 4.5 PR-3 验证
|
||||
|
||||
```bash
|
||||
npm run build:b2c
|
||||
npm run build:bbc
|
||||
node build/update_i18n_from_excel.js # 若改 xlsx
|
||||
npm audit --registry=https://registry.npmjs.org
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 五、PR-4:无法修复项 — Dependabot Accept Risk
|
||||
|
||||
以下告警 **暂无安全修复版本**,在 GitHub Dependabot 标记 **Accept risk** 并统一备注:
|
||||
|
||||
> Vue 2 已 EOL,计划 Vue 3 + Element Plus 迁移后消除。跟踪文档:docs/security/fix-plan.md
|
||||
|
||||
| 包 | 级别 | 原因 |
|
||||
|----|------|------|
|
||||
| `vue@2.7.x` | Low | ReDoS,无官方补丁 |
|
||||
| `element-ui` | Low | 依赖 vue |
|
||||
| `vue-template-compiler` | Moderate | 编译期 XSS,仅构建时;不编译不可信模板 |
|
||||
| `@icon-park/vue` / `lucide-vue` / `vuex` | Low | 连带 vue |
|
||||
| `@shopex-ui/finder` | Low | 连带 element-ui |
|
||||
|
||||
**禁止**:对以上包执行 `npm audit fix --force`。
|
||||
|
||||
---
|
||||
|
||||
## 六、进度跟踪表(执行时填写)
|
||||
|
||||
| PR | 状态 | 执行日 | audit 总数 | Critical | High | 备注 |
|
||||
|----|------|--------|------------|----------|------|------|
|
||||
| 基线 | ✅ | 2026-07-15 | 174 | 34 | 77 | 本地扫描 |
|
||||
| PR-1+2 | ✅ | 2026-07-15 | 68 | 1 | 31 | 删 4 包 + audit fix + axios/qs/lodash/nanoid |
|
||||
| PR-3 | ✅ | 2026-07-15 | 63 | 0 | 24 | xlsx→exceljs + overrides + g2plot/cos |
|
||||
| PR-3b | ✅ | 2026-07-15 | 61 | 0 | 25 | prettier-eslint-cli 5→8 |
|
||||
| PR-4 | ⬜ | | | | | 见 [dependabot-accept-list.md](./dependabot-accept-list.md) |
|
||||
|
||||
**每次 PR 合并后执行:**
|
||||
|
||||
```bash
|
||||
npm audit --registry=https://registry.npmjs.org 2>&1 | grep -E "vulnerabilities|low|moderate|high|critical"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 七、禁止事项
|
||||
|
||||
| 操作 | 原因 |
|
||||
|------|------|
|
||||
| `npm audit fix --force` | 会把 Vue CLI 降到 3.x,构建必挂 |
|
||||
| 一次性升 Vue 3 | 范围过大,应单独立项 |
|
||||
| 升级 `big` 到 0.3.1 | 应 **删除** `big`,不是升级 |
|
||||
| 在 npmmirror 上跑 audit | 不支持,结果为空或报错 |
|
||||
|
||||
---
|
||||
|
||||
## 八、推荐排期(1 人)
|
||||
|
||||
```
|
||||
第 1 天上午 PR-1 删除 4 包 + vue.config 清理 + audit fix + 构建
|
||||
第 1 天下午 PR-2 qs / lodash-es / nanoid / g2plot + 构建
|
||||
第 2~3 天 PR-2 axios 升级 + 全站业务回归
|
||||
第 4 天 PR-3 xlsx → exceljs + sass-loader + overrides
|
||||
第 4 天下午 PR-4 Dependabot bulk dismiss + 文档更新
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 九、CI 建议(修复完成后)
|
||||
|
||||
```yaml
|
||||
# .gitlab-ci.yml 或 GitHub Actions 示例片段
|
||||
- npm audit --registry=https://registry.npmjs.org --audit-level=critical
|
||||
# 或仅 prod:
|
||||
- npm audit --registry=https://registry.npmjs.org --omit=dev --audit-level=high
|
||||
```
|
||||
|
||||
初期可设 `allow_failure: true`,PR-3 完成后改为阻断。
|
||||
|
||||
---
|
||||
|
||||
## 十、快速命令速查
|
||||
|
||||
```bash
|
||||
# 扫描
|
||||
npm audit --registry=https://registry.npmjs.org
|
||||
|
||||
# PR-1
|
||||
npm uninstall babel-preset-env big qiniu-webpack-plugin node-sass-js-importer
|
||||
npm audit fix --registry=https://registry.npmjs.org
|
||||
|
||||
# PR-2
|
||||
npm install axios@1.8.0 qs@6.14.0 lodash-es@4.17.23 nanoid@3.3.8
|
||||
|
||||
# 构建验证
|
||||
npm run build:b2c && npm run build:bbc
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
*执行过程中遇到问题,将现象与 `npm audit` 新数字更新到 §六 进度表及 [dependabot-remediation.md](./dependabot-remediation.md)。*
|
||||
Reference in New Issue
Block a user