登录设备管理
获取登录设备列表
返回已经登录协作账号的设备信息列表。
效果展示

接口定义
Kotlin
KIM.getControl().getLoginDeviceList{
}参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| callback | 闭包<LoginDeviceResult> | 回调,返回列表 |
对象类为LoginDeviceResult,主要字段如下:
| 字段 | 类型 | 说明 |
|---|---|---|
| devices | List<LoginDeviceResultItem> | 登录设备实体列表 |
| result | String | 请求结果 |
对象类LoginDeviceResultItem,主要字段如下:
| 字段 | 类型 | 说明 |
|---|---|---|
| clientIp | String | IP: 183.63.124.162 |
| country | String | 国家 |
| province | String | 省份 |
| city | String | 城市 |
| isp | String | 运营商: 电信 |
| latitude | String | 纬度:23.12897 |
| longitude | String | 经度:113.26683 |
| timeZone | String | 时区:Asia/Shanghai |
| utcTimeZone | String | UTC时区: UTC+8 |
| phonePrefix | String | 电话号码前缀:86 |
| countryCode | String | 国家英文缩写:CN |
| continentCode | String | 洲代码 |
| deviceId | String | 设备id:1b227cda6c10f65f56d230f521a44e5e |
| name | String | 名字:KSOGZD21000005 |
| devType | String | 设备类型:PC |
| platform | String | 平台:windows |
| clientVer | String | 版本:pc-woa_stable:3.15.0 |
| ip | String | IP: 183.63.124.162 |
| loginTime | String | 登录时间:1668928871 |
| lastTime | String | 上次登录时间:1668998111 |
| isCurrent | Bool | 是否当前设备 |
| appName | String | app名称: 金山协作-Windows客户端 |
代码示例
Kotlin
KIM.getControl().getLoginDeviceList {
if (it == null || it.devices.isNullOrEmpty()) {
return@getLoginDeviceList
}
val devices = it.devices!!
}退登指定登录设备
将指定已经登录的设备退登
接口定义
Kotlin
KIM.getControl().kickLoginDevice(deviceId) {
}参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| deviceId | String | 设备id |
| callback | 闭包<KickLoginDeviceResult> | 回调,返回退登结果 |
对象类为KickLoginDeviceResult,主要字段如下:
| 字段 | 类型 | 说明 |
|---|---|---|
| msg | String | 详细信息 |
| result | String | 请求结果 |
代码示例
Kotlin
KIM.getControl().kickLoginDevice(item.deviceId) {
if (it != null && it.result == "ok") {
Toast.makeText(context, "退出成功", Toast.LENGTH_LONG)
.show()
} else {
Toast.makeText(
context,
"退出失败:" + it?.msg,
Toast.LENGTH_LONG
).show()
}
}