From 84c5d7a9f0256b012030f0d92a63ab376a642cdc Mon Sep 17 00:00:00 2001 From: mtvpls Date: Wed, 11 Feb 2026 00:51:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dpostgrep=E7=9A=84=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/api/admin/data_migration/export/route.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/app/api/admin/data_migration/export/route.ts b/src/app/api/admin/data_migration/export/route.ts index c28fd56..0f023e4 100644 --- a/src/app/api/admin/data_migration/export/route.ts +++ b/src/app/api/admin/data_migration/export/route.ts @@ -170,6 +170,14 @@ async function getUserPasswordV2(username: string): Promise { // 检查存储类型 const storageType = process.env.NEXT_PUBLIC_STORAGE_TYPE || 'localstorage'; + // PostgreSQL 存储:使用 getUserPasswordHash 方法 + if (storageType === 'postgres') { + if (typeof storage.getUserPasswordHash === 'function') { + return await storage.getUserPasswordHash(username); + } + return null; + } + // D1 存储:使用 getUserPasswordHash 方法 if (storageType === 'd1') { if (typeof storage.getUserPasswordHash === 'function') {