فهرست منبع

fix: ShareRecord.findUnique -> findFirst (shareCode无unique约束)

MyFramework User 3 ماه پیش
والد
کامیت
a062b61d77
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      server/src/modules/auth/auth.service.ts

+ 1 - 1
server/src/modules/auth/auth.service.ts

@@ -83,7 +83,7 @@ export async function loginWithPhone(phone: string, code?: string, inviteCode?:
 
     // 处理邀请关系
     if (inviteCode) {
-      const shareRecord = await prisma.shareRecord.findUnique({
+      const shareRecord = await prisma.shareRecord.findFirst({
         where: { shareCode: inviteCode },
       });
       if (shareRecord) {