diff --git a/server/routes/public.js b/server/routes/public.js index 496ecd6..abda02d 100644 --- a/server/routes/public.js +++ b/server/routes/public.js @@ -345,8 +345,16 @@ router.post('/orders/:code/consume', async (req, res) => { router.get('/ic-cards/query', async (req, res) => { const q = String(req.query.q || '').trim(); if (!q) { - appendReqLog(req, { category: 'public', type: 'ic_card_query_invalid', level: 'warn', detail: { q } }); - return res.status(400).json({ ok: false, error: 'query required' }); + const cards = (DataService.getIcCards() || []) + .slice() + .sort((a, b) => Number(b?.created_ts || 0) - Number(a?.created_ts || 0)) + .map((card) => ({ + ...presentIcCard(card), + status_label: mapIcCardStatus(card.status), + card_type_label: mapIcCardType(card.card_type) + })); + appendReqLog(req, { category: 'public', type: 'ic_card_query_all', detail: { total: cards.length } }); + return res.json({ ok: true, cards }); } const normCardId = normalizeIcCardId(q); const normOrderCode = String(q || '').trim().toUpperCase(); diff --git a/web/blog.html b/web/blog.html index 6a33198..a637041 100644 --- a/web/blog.html +++ b/web/blog.html @@ -1,66 +1,74 @@ -
- - -
-
+