# 二维码状态-检测（步骤3）

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/qw/doApi:
    post:
      summary: 二维码状态-检测（步骤3）
      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>


        <div style="background: linear-gradient(135deg, rgba(255, 255, 255, 0.1)
        0%, rgba(255, 236, 202, 0.22) 100%); border: 1px solid rgba(255, 241,
        214, 0.65); border-radius: 10px; padding: 16px 20px; box-shadow: 0 2px
        6px rgba(250, 140, 22, 0.06);">
            <p style="margin: 0 0 12px 0; font-size: 16px; color: inherit; font-weight: 600;">核心逻辑</p>
            <div style="display: flex; flex-direction: column; gap: 10px;">
                <div style="display: flex; align-items: flex-start; gap: 8px;">
                    <span style="color: #FA8C16; font-weight: bold; margin-top: 2px;">•</span>
                    <div>
                        <p style="margin: 0; font-size: 14px; color: inherit;"><strong>请求频率：</strong>建议轮询间隔 2-3 秒，避免请求过于频繁。</p>
                    </div>
                </div>
                <div style="display: flex; align-items: flex-start; gap: 8px;">
                    <span style="color: #FA8C16; font-weight: bold; margin-top: 2px;">•</span>
                    <div>
                        <p style="margin: 0; font-size: 14px; color: inherit;"><strong>生命周期：</strong>从“获取二维码”开始，到“登录成功/失败”结束。<br>超时将报错。</p>
                    </div>
                </div>
            </div>
        </div>


        <!-- 折叠面板：Status状态码对照表 默认关闭 -->

        <details style="background:rgba(255,247,230,0.25);border:1px solid
        rgba(255,213,145,0.55);border-radius:8px;margin-bottom:16px;">
            <summary style="font-weight:600;cursor:pointer;padding:12px 16px;">Status状态码对照表</summary>
            <div style="padding:0 16px 16px;">
                <div style="padding: 12px 0; font-size: 14px;">
                    <p style="margin: 0 0 12px 0; color: inherit; opacity: 0.75;">根据返回的 <code style="color: inherit; background: rgba(82, 196, 26, 0.2); border: 1px solid rgba(82, 196, 26, 0.35); padding: 2px 6px; border-radius: 4px; font-weight: bold;">loginQrcodeStatus</code> 字段判断下一步操作：</p>
                    <div style="overflow-x: auto;">
                        <table style="width: 100%; border-collapse: collapse; font-size: 14px;">
                            <thead>
                                <tr style="background: rgba(255, 247, 230, 0.35);">
                                    <th style="padding: 8px 12px; border: 1px solid rgba(255, 241, 214, 0.65); text-align: left; color: inherit; opacity: 0.75; font-weight: 500;">状态码</th>
                                    <th style="padding: 8px 12px; border: 1px solid rgba(255, 241, 214, 0.65); text-align: left; color: inherit; opacity: 0.75; font-weight: 500;">说明</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td style="padding: 8px 12px; border: 1px solid rgba(255, 241, 214, 0.65); color: inherit;">-1</td>
                                    <td style="padding: 8px 12px; border: 1px solid rgba(255, 241, 214, 0.65); color: inherit;">登录状态失效，需要重新扫码登录</td>
                                </tr>
                                <tr>
                                    <td style="padding: 8px 12px; border: 1px solid rgba(255, 241, 214, 0.65); color: inherit;">0</td>
                                    <td style="padding: 8px 12px; border: 1px solid rgba(255, 241, 214, 0.65); color: inherit;">未扫码</td>
                                </tr>
                                <tr>
                                    <td style="padding: 8px 12px; border: 1px solid rgba(255, 241, 214, 0.65); color: inherit;">1</td>
                                    <td style="padding: 8px 12px; border: 1px solid rgba(255, 241, 214, 0.65); color: inherit;">已扫码，待确认</td>
                                </tr>
                                <tr>
                                    <td style="padding: 8px 12px; border: 1px solid rgba(255, 241, 214, 0.65); color: inherit;">2</td>
                                    <td style="padding: 8px 12px; border: 1px solid rgba(255, 241, 214, 0.65); color: inherit;">登录成功</td>
                                </tr>
                                <tr>
                                    <td style="padding: 8px 12px; border: 1px solid rgba(255, 241, 214, 0.65); color: inherit;">3</td>
                                    <td style="padding: 8px 12px; border: 1px solid rgba(255, 241, 214, 0.65); color: inherit;">登录失败</td>
                                </tr>
                                <tr>
                                    <td style="padding: 8px 12px; border: 1px solid rgba(255, 241, 214, 0.65); color: inherit;">4</td>
                                    <td style="padding: 8px 12px; border: 1px solid rgba(255, 241, 214, 0.65); color: inherit;">用户取消登录</td>
                                </tr>
                                <tr>
                                    <td style="padding: 8px 12px; border: 1px solid rgba(255, 241, 214, 0.65); color: inherit;">10</td>
                                    <td style="padding: 8px 12px; border: 1px solid rgba(255, 241, 214, 0.65); color: inherit;">已扫码确认，待检测6位验证码</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </details>
      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/checkLoginQrCode</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/checkLoginQrCode
              params:
                guid: '{{guid}}'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                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:
                      corpId:
                        type: string
                        title: 公司id
                        description: >-
                          <p style="margin: 0; font-size: 14px; color: inherit;
                          line-height: 1.6;">企业 ID。</p>
                      corpLogo:
                        type: string
                        title: 企业Logo
                        description: >-
                          <p style="margin: 0; font-size: 14px; color: inherit;
                          line-height: 1.6;">企业 Logo URL。</p>
                      loginQrcodeKey:
                        type: string
                        title: 二维码 Key
                        description: ''
                      loginQrcodeStatus:
                        type: integer
                        description: >-
                          <p style="margin: 0; font-size: 14px; color: inherit;
                          line-height: 1.6;">扫码状态：<br><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;">-1</code> 未登陆，需要扫码登陆 · <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>
                          未登陆，可免扫码登陆 · <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;">1</code> 已扫码待确认 · <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;">2</code> 登陆成功 · <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;">4</code> 用户取消登陆
                          · <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;">10</code>
                          已扫码确认，待检测6位验证码</p>
                        title: 登录状态
                      nickname:
                        type: string
                        title: 昵称
                        description: ''
                      userId:
                        type: string
                        title: 用户id
                        description: ''
                      avatarUrl:
                        type: string
                        title: 头像
                        description: >-
                          <p style="margin: 0; font-size: 14px; color: inherit;
                          line-height: 1.6;">头像 URL。</p>
                    required:
                      - avatarUrl
                      - corpId
                      - corpLogo
                      - loginQrcodeKey
                      - loginQrcodeStatus
                      - nickname
                      - userId
                    x-apifox-orders:
                      - avatarUrl
                      - corpId
                      - corpLogo
                      - loginQrcodeKey
                      - loginQrcodeStatus
                      - nickname
                      - userId
                    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
                x-apifox-orders:
                  - code
                  - data
                  - msg
              example:
                code: 0
                data:
                  avatarUrl: ''
                  corpId: ''
                  corpLogo: ''
                  loginQrcodeKey: ''
                  loginQrcodeStatus: 1
                  nickname: ''
                  userId: 168885*****
                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-344613851-run
components:
  schemas: {}
  securitySchemes:
    apiKey:
      type: apikey
      in: header
      name: X-WECOM-TOKEN
servers:
  - url: https://new.qiweapi.com/qiwe
    description: 正式环境
security: []

```
