浏览代码

添加二维码服务以支持绑定状态的返回,更新相关逻辑以查询用户二维码绑定信息。

wuyi 2 周之前
父节点
当前提交
7c5c49007f
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/services/qr-code.service.ts

+ 6 - 0
src/services/qr-code.service.ts

@@ -184,6 +184,11 @@ export class QrCodeService {
       }
     }
 
+    const bindRecord = await this.userQrCodeRepository.findOne({
+      where: { qrCodeId: entity.id, isDeleted: false }
+    })
+    const isBind = !!bindRecord
+
     return {
       id: entity.id,
       qrCode: entity.qrCode,
@@ -197,6 +202,7 @@ export class QrCodeService {
       }),
       isActivated: entity.isActivated,
       isVisible,
+      isBind,
       info
     }
   }