# 注冊用戶
>[info] 提交用戶登錄表單;
> 發送登錄短信驗證碼;
> 發送登錄郵箱驗證碼;
## 提交注冊表單
請求地址:[https://你的域名/api/login](https://xn--6qqv7i2xdt95b/api/login)
請求方法:POST
請求數據:
手機號登錄
| 字段 | 名稱 | 說明 |
| --- | --- | --- |
| mobile | 手機號 | |
| smsyzm | 短信驗證碼 | |
郵箱登錄
| 字段 | 名稱 | 說明 |
| --- | --- | --- |
| email | 郵箱 | |
| emailyzm | 郵箱驗證碼 | |
用戶名密碼登錄
| 字段 | 名稱 | 說明 |
| --- | --- | --- |
| username | 用戶名 | |
| password | 密碼 | |
注:(手機登錄,郵箱登錄,用戶名密碼登錄)三選一;
返回數據:
| 字段 | 名稱 | 說明 |
| --- | --- | --- |
| user\_id | 用戶UID | |
| username | 用戶名 | |
| user\_eid | 加密UID | |
| access\_token | 用戶access\_token | |
| access\_token\_timeout | token超期時間 | |
| user\_group\_id | 用戶組ID | |
| user\_group\_action | 用戶權限 | |
請求示例:
```
request({
url: "https://demo.bottlecms.com/api/login",
method: "POST",
data:{
mobile:"13100000009",
smsyzm:"323232"
}
success: (res) => {
if(res.code==200){
//返回成功
console.log(res.obj);
//儲存用戶數據
}
}
});
```
返回示例:
```
{
"success":true,
"code":200,
"msg":"登錄成功",
"obj":{
"user_id": 542,
"username": "wxapp_05511039153",
"user_type": 0,
"user_eid": "f4c80d755a9a1037d7b69993c341bcf9",
"access_token": "$2y$10$FtpTsZBtCwRYizxeI7.C1eNFXOcSF8WpyyG0TnRHBfXzCCTCusp6u",
"access_token_timeout": "2021-05-20 16:01:31",
"user_group_id": "2",
"user_group_action": "karma,nearby,single_index,single_show,voice_index,video_index,manage_like,activity_index,activity_show,appointment_index,appointment_show,moment_index,moment_create,topic_index,topic_show,post_index,post_create,groupchat_index,groupchat_show"
}
}
```
## 發送短信驗證碼
請求地址:[https://你的域名/api/login/sendsmscode](https://xn--6qqv7i2xdt95b/api/login/sendsmscode)
請求方法:POST
請求數據:
| 字段 | 名稱 | 說明 |
| --- | --- | --- |
| mobile | 手機號 | |
返回數據:NULL
請求示例:
```
request({
url: "https://demo.bottlecms.com/api/login/sendsmscode",
method: "POST",
data:{
mobile:"13100000001"
},
success: (res) => {
if(res.code==200){
//返回成功
console.log(res.obj);
}
}
});
```
返回示例:
```
{
"success":true,
"code":200,
"msg":"發送成功",
}
```
## 發送郵箱驗證碼
請求地址:[https://你的域名/api/](https://xn--6qqv7i2xdt95b/api/register/sendemailcode)login[/sendemailcode](https://xn--6qqv7i2xdt95b/api/register/sendemailcode)
請求方法:POST
請求數據:
| 字段 | 名稱 | 說明 |
| --- | --- | --- |
| email | 郵箱 | |
返回數據:NULL
請求示例:
```
request({
url: "https://demo.bottlecms.com/api/login/sendemailcode",
method: "POST",
data:{
email:"abc@abc.com"
},
success: (res) => {
if(res.code==200){
//返回成功
console.log(res.obj);
}
}
});
```
返回示例:
```
{
"success":true,
"code":200,
"msg":"發送成功",
}
```
- 序言
- 安裝及配置
- 環境要求
- 開始安裝
- Redis配置
- 問題處理
- 圖片無法顯示問題
- 站點遷移
- 接口配置
- 短信
- 阿里云短信
- 騰訊云短信
- 郵件
- SMTP發送
- 阿里云郵件API
- 支付
- 微信支付
- 支付寶
- stripe
- PayPal
- 第三方賬號
- 微信登錄
- QQ登錄
- 文件儲存
- 阿里云OSS
- 七牛云KODO
- 微信公眾號
- 微信公眾號接口配置
- 微信模版消息
- 實人認證
- 初始設置
- 按功能設置
- 首頁Banner
- 官方推薦
- 每日推薦
- 單身資料
- 單身列表
- 緣分
- 附近
- 好友
- 聊天
- 聯系方式
- 禮物
- VIP套餐
- 用戶組
- 推薦好友
- 活動
- 約會
- 媒婆
- 專業紅娘
- 話題
- 脫單寶典
- 服務
- 廣告設置
- 自定義頁
- 導入單身
- 導航設置
- 審核
- 頁面設置
- API接口
- 請求說明
- 上傳文件
- 獲取配置信息
- 獲取分類
- API支付
- 獲取支付方式
- 調起支付
- 獲取自定義頁
- 獲取文章
- 獲取文章列表
- 獲取文章詳情
- 意見反饋
- 獲取廣告
- 獲取通知
- 注冊用戶
- 用戶登錄
- 第三方賬號登錄
- 完善資料
- 單身資料
- 獲取單身列表
- 獲取單身詳情