diff --git a/apps/ScreenShareApi/src/main/kotlin/Routing.kt b/apps/ScreenShareApi/src/main/kotlin/Routing.kt index 7ff9288..c606441 100644 --- a/apps/ScreenShareApi/src/main/kotlin/Routing.kt +++ b/apps/ScreenShareApi/src/main/kotlin/Routing.kt @@ -151,16 +151,17 @@ fun Application.configureRouting() { val membership = RoomRepository.member(room.id, user.id) ?: throw ApiException("请先加入房间", 403) val liveKit = liveKitSettings() + val participantIdentity = user.id.toString() + "-" + UUID.randomUUID() val token = LiveKitTokenIssuer(liveKit.apiKey, liveKit.apiSecret).issue( roomName = room.id.toString(), - identity = user.id.toString(), + identity = participantIdentity, participantName = user.displayName, role = membership.role, ) call.respond( TokenResponse( roomName = room.id.toString(), - participantIdentity = user.id.toString(), + participantIdentity = participantIdentity, participantName = user.displayName, livekitUrl = liveKit.publicUrl, token = token,