企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# 注册用户 >[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":"发送成功", } ```