Update server.js via upload script - 2026-10-23 10:54:53
This commit is contained in:
parent
52e6bc7946
commit
228e398fc0
|
|
@ -1050,6 +1050,12 @@ mountPublicApi(app, { dataFile: DATA_FILE, uploadsDir: UPLOADS_DIR, requireAuth,
|
||||||
|
|
||||||
app.use('/uploads', requireAuth, express.static(UPLOADS_DIR));
|
app.use('/uploads', requireAuth, express.static(UPLOADS_DIR));
|
||||||
|
|
||||||
|
// MIC 产品上传(远程浏览器 + 自动填表),模块文件在 mic-upload/ 目录
|
||||||
|
const { registerMicUploadRoutes, attachMicUploadWebSocket } = require('./mic-upload/micUploadRoutes');
|
||||||
|
const micSessions = registerMicUploadRoutes(app, {
|
||||||
|
requireAuth, readData, writeData, callDeepSeekWithRetry, loadAiConfig, encrypt, decrypt,
|
||||||
|
});
|
||||||
|
|
||||||
app.use(express.static(FRONTEND_DIST));
|
app.use(express.static(FRONTEND_DIST));
|
||||||
app.get('*', (req, res) => {
|
app.get('*', (req, res) => {
|
||||||
res.sendFile(path.join(FRONTEND_DIST, 'index.html'));
|
res.sendFile(path.join(FRONTEND_DIST, 'index.html'));
|
||||||
|
|
@ -1070,6 +1076,9 @@ const server = app.listen(PORT, HOST, () => {
|
||||||
console.log(`[customer-crm] running at http://${HOST}:${PORT}`);
|
console.log(`[customer-crm] running at http://${HOST}:${PORT}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
attachMicUploadWebSocket(server, micSessions);
|
||||||
|
|
||||||
|
|
||||||
server.on('error', (e) => {
|
server.on('error', (e) => {
|
||||||
if (e.code === 'EADDRINUSE') {
|
if (e.code === 'EADDRINUSE') {
|
||||||
console.log('[customer-crm] another instance is already running on this port, exiting.');
|
console.log('[customer-crm] another instance is already running on this port, exiting.');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue