Skip to content

Instantly share code, notes, and snippets.

@singleseeker
Created September 30, 2020 03:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save singleseeker/8ff1ae5e519355d51ff18a347a4a35ab to your computer and use it in GitHub Desktop.
Save singleseeker/8ff1ae5e519355d51ff18a347a4a35ab to your computer and use it in GitHub Desktop.
vnt.md

vnt-candy-box API 接口文档

通用请求返回值:

  • 正常
返回值 说明
200 请求成功
  • 异常
返回值 说明
500 参数错误、鉴权失败等

注册

  • URL: IP:Port/register

  • Method: Post

  • Request

    /* 
    HTTP header
    */
    {
    		"phone": "", //手机号,必填
    		"country": "", //国家,必填
        "code": "",//验证码,必填
    		"password": "" //密码,必填
    }
  • Response

    {
        "code": 201
    }

登陆

提供candy-box的账户和密码,返回jwt的token,包含唯一的用户id

  • URL: IP:Port/login

  • Method: Post

  • Request

    /* 
    HTTP header
    */
    {
    		"type":     "", //可选:phone/email/username
    		"value":    "", //账号
    		"password": "" //密码
    }
  • Response

    {
        "code": 200,                 
        "token": "",//jwt,包含用户id和token失效时间
        "user": {}
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment