> ## Documentation Index
> Fetch the complete documentation index at: https://wukong.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 强制设备退出

> 强制用户设备退出/断开连接

## 概述

强制指定用户的设备退出/断开连接，用于管理员踢出用户或处理异常连接。

## 请求体

<ParamField body="uid" type="string" required>
  用户 ID
</ParamField>

<ParamField body="device_flag" type="integer">
  设备标识，用于指定特定设备类型
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "http://localhost:5001/user/device_quit" \
    -H "Content-Type: application/json" \
    -d '{
      "uid": "user123",
      "device_flag": 1
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('http://localhost:5001/user/device_quit', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      uid: 'user123',
      device_flag: 1
    })
  });

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  data = {
      "uid": "user123",
      "device_flag": 1
  }

  response = requests.post('http://localhost:5001/user/device_quit', json=data)
  result = response.json()
  print(result)
  ```

  ```go Go theme={null}
  package main

  import (
      "bytes"
      "encoding/json"
      "fmt"
      "net/http"
  )

  func main() {
      data := map[string]interface{}{
          "uid":         "user123",
          "device_flag": 1,
      }
      
      jsonData, _ := json.Marshal(data)
      
      resp, err := http.Post(
          "http://localhost:5001/user/device_quit",
          "application/json",
          bytes.NewBuffer(jsonData),
      )
      if err != nil {
          panic(err)
      }
      defer resp.Body.Close()
      
      var result map[string]interface{}
      json.NewDecoder(resp.Body).Decode(&result)
      fmt.Printf("%+v\n", result)
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 成功响应 theme={null}
  {
    "status": "ok"
  }
  ```
</ResponseExample>

## 响应字段

<ResponseField name="status" type="string" required>
  操作状态，成功时返回 `"ok"`
</ResponseField>

## 状态码

| 状态码 | 说明          |
| --- | ----------- |
| 200 | 设备退出成功      |
| 400 | 请求参数错误      |
| 404 | 用户不存在或设备未连接 |
| 500 | 服务器内部错误     |
