- 修复 web-admin 与 desktop-client 侧边栏点击无反应:el-menu 的 index 是路径,不能当路由名使用 - 修复 Web 产物目录含点号目录(如 .cache)时 res.sendFile 因 dotfiles:ignore 返回 500 - 后端生产模式:静态托管 Web 端 + SPA 回退、helmet、限流(通用/登录)、trust proxy、 /healthz 与 /readyz、请求耗时日志、生产环境变量强校验、首启动自动迁移与创建管理员、PID 文件 - Web 管理端 PWA:manifest + service worker + 图标,可在浏览器安装为应用 - 新增服务端 + Web 管理端 Windows 安装程序(内置 Node 运行时、启停与服务脚本、开机自启、卸载保留数据) - 新增 Docker/Compose/Nginx 部署样例与 docs/production.md - 新增 UI 回归测试:Web 端 Electron 驱动真实点击 7 项、客户端冒烟 11 项(含侧边栏点击与离线回退)
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { createApp } from 'vue';
|
|
import { createPinia } from 'pinia';
|
|
import ElementPlus from 'element-plus';
|
|
import zhCn from 'element-plus/es/locale/lang/zh-cn';
|
|
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
|
|
import 'element-plus/dist/index.css';
|
|
|
|
import App from './App.vue';
|
|
import router from './router';
|
|
import '@/styles/index.css';
|
|
|
|
const app = createApp(App);
|
|
|
|
// 全量注册 Element Plus 图标,模板里可直接 <el-icon><Bell /></el-icon>
|
|
for (const [name, component] of Object.entries(ElementPlusIconsVue)) {
|
|
app.component(name, component);
|
|
}
|
|
|
|
app.use(createPinia());
|
|
app.use(router);
|
|
app.use(ElementPlus, { locale: zhCn });
|
|
|
|
app.mount('#app');
|
|
|
|
/**
|
|
* 注册 Service Worker(仅生产构建):
|
|
* - 浏览器可「安装为应用」(PWA),断网时仍能打开应用外壳
|
|
* - 不缓存 /api 与 /socket.io,保证数据实时性
|
|
*/
|
|
if (import.meta.env.PROD && 'serviceWorker' in navigator) {
|
|
window.addEventListener('load', () => {
|
|
void navigator.serviceWorker.register('/sw.js').catch((error) => {
|
|
console.warn('[pwa] Service Worker 注册失败:', error);
|
|
});
|
|
});
|
|
}
|