diff --git a/server/api.py b/server/api.py index 371d7b1..12fdf95 100644 --- a/server/api.py +++ b/server/api.py @@ -497,7 +497,7 @@ async def api_market_list(): url = cfg.get("market_url", "http://127.0.0.1:5301") try: async with httpx.AsyncClient(timeout=10) as client: - resp = await client.get(f"{url}/api/collections/dashboards/records?sort=-name&perPage=50") + resp = await client.get(f"{url}/api/collections/dashboards/records?sort=-created&perPage=50") return resp.json() except Exception: return {"items": []} @@ -634,7 +634,7 @@ async def api_market_scenes(): url = cfg.get("market_url", "http://127.0.0.1:5301") try: async with httpx.AsyncClient(timeout=10) as client: - resp = await client.get(f"{url}/api/collections/scenes/records?sort=-name&perPage=50") + resp = await client.get(f"{url}/api/collections/scenes/records?sort=-created&perPage=50") return resp.json() except Exception: return {"items": []} @@ -718,7 +718,7 @@ async def api_market_mine(token: str = ""): r = await client.get(f"{url}/api/collections/dashboards/records?sort=-created&perPage=100", headers={"Authorization": f"Bearer {token}"}) result["dashboards"] = r.json().get("items", []) - r = await client.get(f"{url}/api/collections/scenes/records?sort=-name&perPage=100", + r = await client.get(f"{url}/api/collections/scenes/records?sort=-created&perPage=100", headers={"Authorization": f"Bearer {token}"}) result["scenes"] = r.json().get("items", []) except Exception: diff --git a/static/js/pages/market.js b/static/js/pages/market.js index de36f4a..917da6f 100644 --- a/static/js/pages/market.js +++ b/static/js/pages/market.js @@ -78,10 +78,15 @@ const PageMarket = { _myCardHtml(d, collection) { const pending = d.dashb_pending ? '待审核' : '已通过'; + const created = d.created ? new Date(d.created).toLocaleString('zh-CN', {month:'numeric',day:'numeric',hour:'2-digit',minute:'2-digit'}) : '-'; + const updated = d.updated ? new Date(d.updated).toLocaleString('zh-CN', {month:'numeric',day:'numeric',hour:'2-digit',minute:'2-digit'}) : created; return `