fix: VIP activation not reflecting due to stale session-status token; add missing routes
This commit is contained in:
45
src/index.ts
45
src/index.ts
@@ -91,9 +91,25 @@ app.get('/api/qrcode/public/current', (req, res) => {
|
||||
res.json({ success: true, data: { qrcode: null, url: '' } });
|
||||
});
|
||||
|
||||
// 弹窗
|
||||
app.get('/api/popups/', (req, res) => {
|
||||
res.json({ success: true, data: [] });
|
||||
// 弹窗 (通用参数化路由)
|
||||
app.get('/api/popups/:name', (req, res) => {
|
||||
const { name } = req.params;
|
||||
const popups: Record<string, any> = {
|
||||
test_beta_01: { id: 'test_beta_01', title: '测试弹窗', content: '', shown: false },
|
||||
};
|
||||
res.json({ success: true, data: popups[name] ?? null });
|
||||
});
|
||||
|
||||
// 嘉豪弹窗
|
||||
app.get('/api/jiahao', (req, res) => {
|
||||
res.json({
|
||||
success: true,
|
||||
data: {
|
||||
enabled: false,
|
||||
message: '',
|
||||
imageUrl: '',
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
// 售后教程弹窗
|
||||
@@ -172,6 +188,29 @@ app.get('/api/avatars', (req, res) => {
|
||||
res.json({ success: true, data: [] });
|
||||
});
|
||||
|
||||
// ============================================
|
||||
// 更新服务 (electron-updater)
|
||||
// ============================================
|
||||
|
||||
// 更新配置
|
||||
app.get('/update-config.json', (req, res) => {
|
||||
res.json({
|
||||
version: '7.0.4',
|
||||
url: '',
|
||||
notes: '',
|
||||
mandatory: false,
|
||||
});
|
||||
});
|
||||
|
||||
// latest.yml (electron-updater 标准格式)
|
||||
app.get('/latest.yml', (req, res) => {
|
||||
res.type('text/yaml');
|
||||
res.send(`version: 7.0.4
|
||||
files: []
|
||||
releaseDate: '2024-01-01T00:00:00.000Z'
|
||||
`);
|
||||
});
|
||||
|
||||
// ============================================
|
||||
// 错误处理
|
||||
// ============================================
|
||||
|
||||
Reference in New Issue
Block a user