diff --git a/index.html b/index.html index 0e96809..af9d1c9 100644 --- a/index.html +++ b/index.html @@ -47,7 +47,9 @@ } }); - +
diff --git a/package-lock.json b/package-lock.json index a08bc55..9f6bdf3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "axios": "^1.6.0", "element-plus": "^2.5.0", "pinia": "^2.1.0", + "sortablejs": "^1.15.0", "spark-md5": "^3.0.2", "vue": "^3.4.0", "vue-router": "^4.3.0" @@ -1680,6 +1681,12 @@ "node": ">=12.17.0" } }, + "node_modules/sortablejs": { + "version": "1.15.0", + "resolved": "https://registry.npmmirror.com/sortablejs/-/sortablejs-1.15.0.tgz", + "integrity": "sha512-bv9qgVMjUMf89wAvM6AxVvS/4MX3sPeN0+agqShejLU5z5GX4C75ow1O2e5k4L6XItUyAK3gH6AxSbXrOM5e8w==", + "license": "MIT" + }, "node_modules/source-map-js": { "version": "1.2.1", "license": "BSD-3-Clause", diff --git a/package.json b/package.json index 2a79154..4d11a37 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "axios": "^1.6.0", "element-plus": "^2.5.0", "pinia": "^2.1.0", + "sortablejs": "^1.15.0", "spark-md5": "^3.0.2", "vue": "^3.4.0", "vue-router": "^4.3.0" diff --git a/src/main.js b/src/main.js index 1314aca..8d99e71 100644 --- a/src/main.js +++ b/src/main.js @@ -8,6 +8,13 @@ import 'element-plus/dist/index.css' // 全局样式(含 Element Plus 主题色变量,防止 getThemeColors 解构 undefined 报错) import './styles/global.css' +// SortableJS:新闻/轮播的拖拽排序依赖 window.Sortable(见 Admin.vue initNewsSortable/initCarouselSortable)。 +// 原先由 index.html 从 cdn.jsdelivr.net 加载,内网/离线环境取不到时会静默失效 +// (Admin.vue 内的 `if (!window.Sortable) return` 守卫不会报错也不提示)。 +// 改为本地依赖并由 Vite 打包进产物,彻底消除对外网 CDN 的运行时依赖。 +import Sortable from 'sortablejs' +window.Sortable = Sortable + import App from './App.vue' import router from './router' // 主动 token 续期(防活跃用户因 token 过期被强制踢回登录页)