|
|
@@ -161,10 +161,8 @@ export class QrCodeService {
|
|
|
info = await this.linkInfoRepository.findOne({ where: { qrCodeId: entity.id } })
|
|
|
}
|
|
|
|
|
|
- if (!isAdmin && info && info.isVisible === false) {
|
|
|
- info = null
|
|
|
- isVisible = false
|
|
|
- } else if (info) {
|
|
|
+ // 先设置 isVisible 状态
|
|
|
+ if (info) {
|
|
|
isVisible = info.isVisible ?? true
|
|
|
}
|
|
|
|
|
|
@@ -184,6 +182,13 @@ export class QrCodeService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 如果不是管理员且 isVisible 为 false,只返回图片 URL
|
|
|
+ if (!isAdmin && info && info.isVisible === false) {
|
|
|
+ const photoUrl = 'photoUrl' in info ? info.photoUrl : ''
|
|
|
+ info = { photoUrl }
|
|
|
+ isVisible = false
|
|
|
+ }
|
|
|
+
|
|
|
const bindRecord = await this.userQrCodeRepository.findOne({
|
|
|
where: { qrCodeId: entity.id, isDeleted: false }
|
|
|
})
|