feat: 设置页新增「系统与更新」,按 GitHub 版本号检查更新
- 顶层 package.json 作为应用版本唯一来源(happy-export v1.0.0) - backend/lib/updater.js:查 GitHub Release(优先)或 tag,与本机版本做 semver 比对 - backend/routes/system.js:GET /api/system/info、GET /api/system/check-update(30s 缓存) - /api/health 版本号改为读真实版本 - 设置页新增第 4 个分类:当前版本 / 更新源仓库 / 检查更新(含更新说明折叠) - 新增 RefreshIcon
This commit is contained in:
+6
-1
@@ -3,6 +3,8 @@ const path = require('path');
|
||||
const cors = require('cors');
|
||||
const http = require('http');
|
||||
const db = require('./db/db');
|
||||
const updater = require('./lib/updater');
|
||||
const systemRoutes = require('./routes/system');
|
||||
|
||||
const app = express();
|
||||
const PORT = process.env.PORT || 4300;
|
||||
@@ -71,11 +73,14 @@ app.use(express.static(path.join(__dirname, '../frontend/dist')));
|
||||
app.get('/api/health', (req, res) => {
|
||||
res.json({
|
||||
status: 'ok',
|
||||
version: '1.0.0',
|
||||
version: updater.currentVersion(),
|
||||
timestamp: new Date().toISOString()
|
||||
});
|
||||
});
|
||||
|
||||
// 系统信息与版本更新检查
|
||||
app.use('/api/system', systemRoutes);
|
||||
|
||||
// 获取工作台数据
|
||||
app.get('/api/dashboard', (req, res) => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user