登錄

接口約定

  • 使用https
  • restful風(fēng)格
  • 用戶端:https://{域名}/api/{接口版本號}/{resource}/{resource_id}/{sub_resource}/{sub_resource_id}/{action}?{query_string}
  • 管理端:https://{域名}/admin/api/{接口版本號}/{resource}/{resource_id}/{sub_resource}/{sub_resource_id}/{action}?{query_string}
  • 測試環(huán)境域名babieta.xivan.cn
  • 正式環(huán)境域名待定
  • 公共參數(shù)放在header,如userid,token,unionid,version等
  • resource: auth

接口


POST /auth/login

name cname type Description
用途 用戶登錄,無注冊態(tài)則自動注冊
版本號 v1.0
請求數(shù)據(jù):

query_string 參數(shù)

name cname type Description
avatar_url 頭像 string
city 城市 string
country 國家 string
gender 性別 string
language 語言 string
nickname 昵稱 string
province 省份 string

curl -XPOST https://babieta.xivan.cn/api/v1.0/auth/login -d '{"code":"xxx", "nickname":"134",...}'
wx.request({
          "url": "https://babieta.xivan.cn/api/v1.0/auth/login",
          "method": "POST",
          "success": res => {
            console.log(res)
          },
          "data": { code: "023RaD4B04iEDg2jV93B0RCC4B0RaD4o", "nickname":"134", ... },
          "dataType": "json",
          "header": {
            "content-type": "application/json",
          },
          "complete": res => {
            console.log(res)
          }
        })
返回數(shù)據(jù):
name cname type Description
code int 返回碼 0成功 非0失敗
msg string 錯誤信息
userid string
token string 登錄憑證

{
    "code"0,
    "msg":"",
    "userid":"123",
    "token":"xxxx"
}
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容