修改推送数据格式

This commit is contained in:
2025-07-02 21:05:33 +08:00
parent 318c6b5cc1
commit f347e1bd9c
9 changed files with 137 additions and 22 deletions

4
app.js
View File

@ -14,6 +14,8 @@ const pushRouter = require('./routes/push');
const {sendHeartbeat} = require('./lib/sse');
const config = require('./config');
const timestamp = require('./utils/timeFormatter');
const app = express();
// 中间件
@ -33,7 +35,7 @@ const errorHandler = (err, req, res, next) => {
res.status(500).json({
code: 500,
error: 'Internal Server Error',
timestamp: new Date().toISOString()
timestamp: timestamp.formatTime()
});
};
app.use(errorHandler);