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') {