101 lines
1.2 KiB
Markdown
101 lines
1.2 KiB
Markdown
### 0. 说明
|
||
测试环境:https://oauth-svr.cebggame.com/task
|
||
|
||
正式环境:https://taskapi.cebggame.com
|
||
|
||
### 1. 钱包登录
|
||
|
||
|
||
#### Request
|
||
|
||
- URL:`/api/bigget/login`
|
||
- 方法:`POST`
|
||
- 头部:
|
||
- Content-type: application/json
|
||
- Body:
|
||
|
||
```json
|
||
{
|
||
"code": String,
|
||
"message": SiweMessage
|
||
}
|
||
```
|
||
|
||
SiweMessage说明: https://docs.login.xyz/sign-in-with-ethereum/quickstart-guide/creating-siwe-messages
|
||
|
||
|
||
|
||
#### Response
|
||
|
||
```json
|
||
{
|
||
"token": String,
|
||
}
|
||
```
|
||
|
||
### 2.\* 发送邮件验证码
|
||
|
||
#### Request
|
||
|
||
- URL:`/api/bigget/send_code`
|
||
- 方法:POST
|
||
- 头部:
|
||
- Authorization: Bearer JWT_token
|
||
|
||
|
||
body:
|
||
|
||
```js
|
||
{
|
||
"email": "email"
|
||
}
|
||
|
||
```
|
||
> 验证email的正则
|
||
```js
|
||
export const isEmail = (email) => {
|
||
const reg = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/
|
||
return reg.test(email)
|
||
}
|
||
```
|
||
|
||
#### Response
|
||
|
||
```js
|
||
{
|
||
}
|
||
```
|
||
|
||
### 3.\* 验证邮件地址
|
||
|
||
#### Request
|
||
|
||
- URL:`/api/bigget/verify_email`
|
||
- 方法:POST
|
||
- 头部:
|
||
- Authorization: Bearer JWT_token
|
||
|
||
|
||
body:
|
||
|
||
```js
|
||
{
|
||
"email": "email",
|
||
"code": "123221"
|
||
}
|
||
|
||
```
|
||
> 验证code的正则
|
||
```js
|
||
export const isValiedCode = (code) => {
|
||
return /^\d{6}$/.test(code)
|
||
}
|
||
```
|
||
|
||
#### Response
|
||
|
||
```js
|
||
{
|
||
"token": String,
|
||
}
|
||
``` |