# 用户状态

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/qw/doApi:
    post:
      summary: 用户状态
      deprecated: false
      description: >-
        <div style="background: linear-gradient(135deg, rgba(255, 213, 145,
        0.45) 0%, rgba(255, 255, 255, 0.06) 100%); border: 1px solid rgba(255,
        236, 202, 0.7); border-radius: 12px; padding: 20px 28px; margin-bottom:
        20px; box-shadow: 0 4px 12px rgba(250, 140, 22, 0.08)">
          <h3 style="margin: 0 0 8px 0; font-size: 18px; font-weight: 600; color: inherit; border: none; padding-bottom: 0;">用户状态</h3>
          <p style="margin: 0; font-size: 14px; color: inherit; line-height: 1.6">用于查询指定设备的当前登录状态，确认是否已在线。（不要频繁调用）</p>
        </div>
      tags:
        - API参考/基础能力/登录模块
      parameters:
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
        - name: X-QIWEI-TOKEN
          in: header
          description: >-
            <p style="margin: 0; font-size: 14px; color: inherit; line-height:
            1.6;">进入 <a href="https://new.qiweapi.com/tokens" style="color:
            inherit; text-decoration: underline; font-weight: 600;">应用凭证</a>，复制
            <code style="color: inherit; background: rgba(82, 196, 26, 0.08);
            border: 1px solid rgba(82, 196, 26, 0.1); padding: 2px 4px;
            border-radius: 3px;">TokenId</code>。</p>
          required: true
          example: '{{tokenId}}'
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                method:
                  type: string
                  title: 执行方法
                  description: >-
                    <code style="color: inherit; background: rgba(82, 196, 26,
                    0.08); border: 1px solid rgba(82, 196, 26, 0.1); padding:
                    2px 4px; border-radius: 3px;">/login/checkLogin</code>
                params:
                  type: object
                  properties:
                    guid:
                      type: string
                      title: 设备 ID
                      description: >-
                        <p style="margin: 0; font-size: 14px; color: inherit;
                        line-height: 1.6;">设备唯一标识 <code style="color: inherit;
                        background: rgba(82, 196, 26, 0.08); border: 1px solid
                        rgba(82, 196, 26, 0.1); padding: 2px 4px; border-radius:
                        3px;">guid</code>，由「创建设备」接口返回，业务接口必传。</p>
                  required:
                    - guid
                  x-apifox-orders:
                    - guid
                  title: 请求参数
              required:
                - method
                - params
              x-apifox-orders:
                - method
                - params
            example:
              method: /login/checkLogin
              params:
                guid: '{{guid}}'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                x-apifox-refs:
                  01KMCNR0FR8C97CW1HVSPGXB1H:
                    type: object
                    properties: {}
                    x-apifox-orders: []
                x-apifox-orders:
                  - 01KMCNR0FR8C97CW1HVSPGXB1H
                  - code
                  - data
                  - msg
                properties:
                  code:
                    type: integer
                    title: 状态码
                    description: >-
                      <p style="margin: 0; font-size: 14px; color: inherit;
                      line-height: 1.6;">状态码，<code style="color: inherit;
                      background: rgba(82, 196, 26, 0.08); border: 1px solid
                      rgba(82, 196, 26, 0.1); padding: 2px 4px; border-radius:
                      3px;">0</code> 成功。</p>
                  data:
                    type: object
                    properties:
                      errorCode:
                        type: integer
                        title: 错误码
                        description: ''
                      errorMsg:
                        type: string
                        title: 错误消息
                        description: ''
                      ' userId':
                        type: string
                        title: 用户id
                        description: ''
                      lastActiveTime:
                        type: integer
                        title: 最后活跃时间
                        description: ''
                      ' userOnlineStatus':
                        type: integer
                        description: >-
                          <p style="margin: 0; font-size: 14px; color: inherit;
                          line-height: 1.6;">=-1 未登陆，需要扫码登陆 =0 未登陆，可免扫码登陆 =1
                          已扫码，待确认 =2 登陆成功 =4 用户取消登陆 =10 已扫码确认，待检测6位验证码</p>
                        title: 用户在线状态
                      corpLogo:
                        type: string
                        title: 企业Logo
                        description: >-
                          <p style="margin: 0; font-size: 14px; color: inherit;
                          line-height: 1.6;">企业 Logo URL。</p>
                      corpName:
                        type: string
                        title: 公司名称
                        description: ''
                      nickname:
                        type: string
                        title: 昵称
                        description: ''
                    x-apifox-orders:
                      - errorCode
                      - errorMsg
                      - ' userId'
                      - lastActiveTime
                      - ' userOnlineStatus'
                      - corpLogo
                      - corpName
                      - nickname
                    required:
                      - errorCode
                      - errorMsg
                      - ' userId'
                      - lastActiveTime
                      - ' userOnlineStatus'
                      - corpLogo
                      - corpName
                      - nickname
                    title: 响应数据
                    description: >-
                      <p style="margin: 0; font-size: 14px; color: inherit;
                      line-height: 1.6;">业务数据。</p>
                  msg:
                    type: string
                    title: 说明
                    description: >-
                      <p style="margin: 0; font-size: 14px; color: inherit;
                      line-height: 1.6;">返回说明。</p>
                required:
                  - code
                  - data
                  - msg
              example:
                code: 200
                data:
                  errorCode: 0
                  errorMsg: U1VDQ0VTUw==
                  userId: 1688852****
                  lastActiveTime: 0
                  userOnlineStatus: 2
                  corpLogo: ''
                  corpName: ''
                  nickname: nihao
                msg: 成功
          headers: {}
          x-apifox-name: 成功
      security: []
      x-apifox-folder: API参考/基础能力/登录模块
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/7051713/apis/api-344613856-run
components:
  schemas: {}
  securitySchemes:
    apiKey:
      type: apikey
      in: header
      name: X-WECOM-TOKEN
servers:
  - url: https://new.qiweapi.com/qiwe
    description: 正式环境
security: []

```
