mini-program-auth.md 3.04 KB

小程序授权

OpenAPI Specification

openapi: 3.0.1
info:
  title: ''
  version: 1.0.0
paths:
  /srv/:
    post:
      summary: 小程序授权
      deprecated: false
      description: |
        # 登录流程设计
        - 先小程序授权
        - 如果返回 user 为空,则需要调用登录接口
        - 如果返回 user 非空,则不需要调用登录接口,授权接口内部按照openid绑定的账号,自动登录
      tags:
        - 微信
      parameters:
        - name: f
          in: query
          description: ''
          required: true
          example: manulife
          schema:
            type: string
        - name: a
          in: query
          description: ''
          required: true
          example: openid
          schema:
            type: string
        - name: code
          in: query
          description: ''
          required: true
          example: ''
          schema:
            type: string
        - name: openid
          in: query
          description: 指定一个openid用来测试
          required: true
          example: oAHBN10P-hn-vF1cTY4tQeStQFmU
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    description: 0=失败,1=成功
                  msg:
                    type: string
                  data:
                    type: object
                    properties:
                      user:
                        type: object
                        properties:
                          id:
                            type: integer
                            title: 用户ID
                          avatar_url:
                            type: string
                            title: 头像
                          name:
                            type: string
                            title: 姓名
                        x-apifox-orders:
                          - id
                          - name
                          - avatar_url
                        title: openid绑定的用户信息
                        required:
                          - id
                          - avatar_url
                          - name
                    x-apifox-orders:
                      - user
                    required:
                      - user
                x-apifox-orders:
                  - code
                  - msg
                  - data
                required:
                  - code
                  - msg
                  - data
          headers: {}
          x-apifox-name: 成功
          x-apifox-ordering: 0
      security: []
      x-apifox-folder: 微信
      x-apifox-status: testing
      x-run-in-apifox: https://app.apifox.com/web/project/7792797/apis/api-413906665-run
components:
  schemas: {}
  responses: {}
  securitySchemes: {}
servers: []
security: []