task-svr/docs/bitget.md
2024-08-21 16:30:49 +08:00

1.2 KiB
Raw Blame History

0. 说明

测试环境:https://oauth-svr.cebggame.com/task

正式环境:https://taskapi.cebggame.com

1. 钱包登录

Request

  • URL/api/bigget/login
  • 方法:POST
  • 头部:
    • Content-type: application/json
  • Body:
{
    "code": String,
    "message": SiweMessage
}

SiweMessage说明: https://docs.login.xyz/sign-in-with-ethereum/quickstart-guide/creating-siwe-messages

Response

{
    "token": String,
}

2.* 发送邮件验证码

Request

  • URL/api/bigget/send_code
  • 方法POST
  • 头部:
    • Authorization: Bearer JWT_token

body:

{
	"email": "email" 
}

验证email的正则

export const isEmail = (email) => {
  const reg = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/
  return reg.test(email)
}

Response

{ 
}

3.* 验证邮件地址

Request

  • URL/api/bigget/verify_email
  • 方法POST
  • 头部:
    • Authorization: Bearer JWT_token

body:

{
	"email": "email",
	"code": "123221"
}

验证code的正则

export const isValiedCode = (code) => {
  return /^\d{6}$/.test(code)
}

Response

{
    "token": String,
}