# 二维码-获取（步骤2）

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/qw/doApi:
    post:
      summary: 二维码-获取（步骤2）
      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;">获取登录二维码及 loginQrcodeKey，供手机企微扫码完成设备绑定。</p>
        </div>


        <div style="background: rgba(255, 247, 230, 0.25); border: 1px solid
        rgba(255, 213, 145, 0.55); border-radius: 6px; padding: 12px 16px;
        margin-bottom: 16px;">
            <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>请使用参数 <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;">useCache=false</code>，获取全新二维码。</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>提示设备不存在/不在线时，获取二维码。登录</p>
                </div>
            </div>
        </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
                  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/getLoginQrcode</code>
                params:
                  type: object
                  properties:
                    guid:
                      type: string
                      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>
                      title: 设备 ID
                    useCache:
                      type: boolean
                      description: >-
                        <p style="margin: 0; font-size: 14px; color: inherit;
                        line-height: 1.6;">默认false ，可不传 </p>
                      title: 是否使用缓存数据
                  required:
                    - guid
                    - useCache
                  x-apifox-orders:
                    - guid
                    - useCache
              required:
                - method
                - params
              x-apifox-orders:
                - method
                - params
            example:
              method: /login/getLoginQrcode
              params:
                guid: '{{guid}}'
                useCache: false
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    title: 状态码
                  data:
                    type: object
                    properties:
                      loginQrcodeBase64Data:
                        type: string
                        description: >-
                          <p style="margin: 0; font-size: 14px; color: inherit;
                          line-height: 1.6;">二维码 Base64 图片。</p>
                        title: 二维码数据流
                      loginQrcodeKey:
                        type: string
                        title: 二维码key
                    required:
                      - loginQrcodeBase64Data
                      - loginQrcodeKey
                    x-apifox-orders:
                      - loginQrcodeBase64Data
                      - loginQrcodeKey
                    title: 响应数据
                  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:
                  loginQrcodeBase64Data: /9jqo8Zbik......UUUUV//Z
                  loginQrcodeKey: FFFFDDDDDFFFFFF
                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-344613848-run
components:
  schemas: {}
  securitySchemes:
    apiKey:
      type: apikey
      in: header
      name: X-WECOM-TOKEN
servers:
  - url: https://new.qiweapi.com/qiwe
    description: 正式环境
security: []

```
