소스 검색

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