From 279720e2760f70c4a22645ba1e6f823adbeba1f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B3=E4=BD=A9=E5=BA=AD?= Date: Tue, 5 Aug 2025 11:55:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E7=94=A8=E6=88=B6=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=9F=A5=E8=A9=A2=E5=A4=B1=E6=95=97=E5=95=8F=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/users/route.ts | 4 ++-- components/admin/admin-layout.tsx | 4 ++-- components/admin/user-management.tsx | 7 +++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/api/users/route.ts b/app/api/users/route.ts index 0bdfb40..82c7918 100644 --- a/app/api/users/route.ts +++ b/app/api/users/route.ts @@ -54,8 +54,8 @@ export async function GET(request: NextRequest) { GROUP BY judge_id ) review_stats ON u.id = review_stats.judge_id ORDER BY u.created_at DESC - LIMIT ? OFFSET ? - `, [limit, offset]); + LIMIT ${limit} OFFSET ${offset} + `); // 分頁資訊 const totalPages = Math.ceil(total / limit); diff --git a/components/admin/admin-layout.tsx b/components/admin/admin-layout.tsx index 160cd7c..80a1426 100644 --- a/components/admin/admin-layout.tsx +++ b/components/admin/admin-layout.tsx @@ -171,7 +171,7 @@ export function AdminLayout({ children, currentPage, onPageChange }: AdminLayout setShowLogoutDialog(false) // Check if this is a popup/new tab opened from main site - if (window.opener && !window.opener.closed) { + if (typeof window !== 'undefined' && window.opener && !window.opener.closed) { // If opened from another window, close this tab and focus parent window.opener.focus() window.close() @@ -214,7 +214,7 @@ export function AdminLayout({ children, currentPage, onPageChange }: AdminLayout - {window.opener && !window.opener.closed && ( + {typeof window !== 'undefined' && window.opener && !window.opener.closed && (