用户 Session

获取活跃的 Session 列表

URI

GET /admin-api/user/list_active_sessions

请求示例

Shell

curl http://{admin-site}/admin-api/user/list_active_sessions

响应示例

Status: 200 OK
{
  "time": 1614926543,
  "data": {
    "data": [{
      "uid": 2,
      "plugin": "Builtin",
      "username": "edge-admin",
      "remote_addr": "120.24.93.123",
      "expires": 1615024689
    }, {
      "uid": 2,
      "plugin": "Builtin",
      "username": "edge-admin",
      "remote_addr": "120.24.93.123",
      "expires": 1616981168
    }],
    "meta": {
      "count": 2
    }
  },
  "status": 0
}

删除指定用户的 Session

URI

DELETE /admin-api/user/delete_sessions
'{
    uid: 2
  }'

URI参数

  • uid

    type: integer

    required: yes

    description: Session 将被删除的用户 id

请求示例

Shell

curl -X DELETE http://{admin-site}/admin-api/user/delete_sessions

响应示例

Status: 200 OK
{
  "time": 1614926868,
  "status": 0,
  "msg": "sessions deleted"
}