tag(功能):同一帐号可以多处登录
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user