tag(功能):同一帐号可以多处登录
This commit is contained in:
@@ -151,16 +151,17 @@ fun Application.configureRouting() {
|
|||||||
val membership = RoomRepository.member(room.id, user.id)
|
val membership = RoomRepository.member(room.id, user.id)
|
||||||
?: throw ApiException("请先加入房间", 403)
|
?: throw ApiException("请先加入房间", 403)
|
||||||
val liveKit = liveKitSettings()
|
val liveKit = liveKitSettings()
|
||||||
|
val participantIdentity = user.id.toString() + "-" + UUID.randomUUID()
|
||||||
val token = LiveKitTokenIssuer(liveKit.apiKey, liveKit.apiSecret).issue(
|
val token = LiveKitTokenIssuer(liveKit.apiKey, liveKit.apiSecret).issue(
|
||||||
roomName = room.id.toString(),
|
roomName = room.id.toString(),
|
||||||
identity = user.id.toString(),
|
identity = participantIdentity,
|
||||||
participantName = user.displayName,
|
participantName = user.displayName,
|
||||||
role = membership.role,
|
role = membership.role,
|
||||||
)
|
)
|
||||||
call.respond(
|
call.respond(
|
||||||
TokenResponse(
|
TokenResponse(
|
||||||
roomName = room.id.toString(),
|
roomName = room.id.toString(),
|
||||||
participantIdentity = user.id.toString(),
|
participantIdentity = participantIdentity,
|
||||||
participantName = user.displayName,
|
participantName = user.displayName,
|
||||||
livekitUrl = liveKit.publicUrl,
|
livekitUrl = liveKit.publicUrl,
|
||||||
token = token,
|
token = token,
|
||||||
|
|||||||
Reference in New Issue
Block a user