feat: 初始化 ChatOA 企业协作 OA 系统

This commit is contained in:
2026-08-20 19:36:07 +08:00
commit 6d7a1f6e63
90 changed files with 20067 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
const { app, BrowserWindow } = require('electron');
const path = require('path');
const DEV_SERVER_URL = process.env.VITE_DEV_SERVER_URL;
function createWindow() {
const win = new BrowserWindow({
width: 1200,
height: 800,
minWidth: 980,
minHeight: 640,
title: 'ChatOA',
autoHideMenuBar: true,
webPreferences: {
preload: path.join(__dirname, 'preload.cjs'),
contextIsolation: true,
nodeIntegration: false,
},
});
if (DEV_SERVER_URL) {
win.loadURL(DEV_SERVER_URL);
win.webContents.openDevTools({ mode: 'detach' });
} else {
win.loadFile(path.join(__dirname, '..', 'dist', 'index.html'));
}
}
app.whenReady().then(() => {
createWindow();
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) createWindow();
});
});
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') app.quit();
});
+11
View File
@@ -0,0 +1,11 @@
const { contextBridge } = require('electron');
// 预留:后续如需在渲染进程使用系统能力(文件选择、系统通知等)在此暴露
contextBridge.exposeInMainWorld('chatoa', {
platform: process.platform,
versions: {
electron: process.versions.electron,
node: process.versions.node,
chrome: process.versions.chrome,
},
});