feat(frontend): SortableJS 改为本地依赖,移除公网 CDN 运行时依赖(R33)

- package.json: 新增 sortablejs@^1.15.0(dependencies)
- src/main.js: import Sortable + 挂载 window.Sortable
  (保留全局挂载形式 => Admin.vue 的 window.Sortable.* 零改动)
- index.html: 删除 cdn.jsdelivr.net 的 <script>,留注释说明原因
- 原因: 内网/离线部署时 CDN 不可达 => window.Sortable 为 undefined,
  而 Admin.vue:3089/3276 的 `if (!window.Sortable) return` 会静默吞掉
  新闻/轮播的拖拽排序(界面零提示)
- 验证: 真 chromium 16/16 PASS(含整站 0 次 CDN 请求、宿主元素 expando
  Sortable<数字> 探针、news/carousel handle 正确、0 pageerror/0 console.error);
  构建 ✓ built in 18.57s / VITE_EXIT=0; TDZ src 38 + dist 26 全 PASS
This commit is contained in:
2026-09-29 09:57:48 +08:00
parent cb672b621a
commit 042e0a8e1f
4 changed files with 18 additions and 1 deletions

View File

@@ -47,7 +47,9 @@
}
});
</script>
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.15.0/Sortable.min.js"></script>
<!-- SortableJS 已改为 npm 依赖本地打包(见 src/main.js),不再从公网 CDN 引入:
内网/离线部署时 CDN 不可达会让 window.Sortable 缺失,
而 Admin.vue 中的 `if (!window.Sortable) return` 会静默吞掉新闻/轮播的拖拽排序功能。 -->
</head>
<body>
<div id="app"></div>