114 lines
2.8 KiB
JavaScript
114 lines
2.8 KiB
JavaScript
/**
|
|
* @swagger
|
|
* tags:
|
|
* name: 认证
|
|
* description: 代理认证相关接口
|
|
*/
|
|
|
|
/**
|
|
* @swagger
|
|
* /auth/login:
|
|
* post:
|
|
* summary: 代理登录
|
|
* tags: [认证]
|
|
* requestBody:
|
|
* required: true
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* type: object
|
|
* required:
|
|
* - phone
|
|
* - password
|
|
* properties:
|
|
* phone:
|
|
* type: string
|
|
* description: 代理手机号
|
|
* password:
|
|
* type: string
|
|
* description: 登录密码
|
|
* captchaId:
|
|
* type: string
|
|
* description: 验证码ID
|
|
* captchaText:
|
|
* type: string
|
|
* description: 验证码文本
|
|
* responses:
|
|
* 200:
|
|
* description: 登录成功
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* type: object
|
|
* properties:
|
|
* success:
|
|
* type: boolean
|
|
* example: true
|
|
* data:
|
|
* type: object
|
|
* properties:
|
|
* token:
|
|
* type: string
|
|
* description: JWT令牌
|
|
* agent:
|
|
* $ref: '#/components/schemas/Agent'
|
|
* 400:
|
|
* description: 参数错误
|
|
* 401:
|
|
* description: 登录失败
|
|
*/
|
|
|
|
/**
|
|
* @swagger
|
|
* /auth/me:
|
|
* get:
|
|
* summary: 获取当前代理信息
|
|
* tags: [认证]
|
|
* security:
|
|
* - bearerAuth: []
|
|
* responses:
|
|
* 200:
|
|
* description: 获取成功
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* type: object
|
|
* properties:
|
|
* success:
|
|
* type: boolean
|
|
* example: true
|
|
* data:
|
|
* $ref: '#/components/schemas/Agent'
|
|
* 401:
|
|
* description: 未授权或令牌无效
|
|
* 500:
|
|
* description: 服务器错误
|
|
*/
|
|
|
|
/**
|
|
* @swagger
|
|
* /auth/logout:
|
|
* post:
|
|
* summary: 代理登出
|
|
* tags: [认证]
|
|
* security:
|
|
* - bearerAuth: []
|
|
* responses:
|
|
* 200:
|
|
* description: 登出成功
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* type: object
|
|
* properties:
|
|
* success:
|
|
* type: boolean
|
|
* example: true
|
|
* message:
|
|
* type: string
|
|
* example: "登出成功"
|
|
* 401:
|
|
* description: 未授权
|
|
* 500:
|
|
* description: 服务器错误
|
|
*/ |