Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

用户注册用到的接口。 #6

Open
AnAloneJaver opened this issue Aug 5, 2022 · 0 comments
Open

用户注册用到的接口。 #6

AnAloneJaver opened this issue Aug 5, 2022 · 0 comments
Assignees
Labels
feature Dev Feature

Comments

@AnAloneJaver
Copy link
Contributor

AnAloneJaver commented Aug 5, 2022

1.检查用户名是否重复的接口

地址:http://ip:port/player/checkUsername
请求方式:post
参数:

{
	username:'用户名'
}

参数格式:json
返回示例:

{
    code:200,
    message:‘SUCCESS’,
    exist:false(true)
   //用户名不存在为false,存在为true
  }

2.发送邮箱验证码

目前的邮箱发送验证码的的限制为:
2.1限制每个ip一天可以发送成功2次验证码邮件
2.2自服务器启动起,如果发送邮件异常超过10次,停止服务,保护一下发送邮箱。
这两个参数目前可以在server/config/application.js文件中的email的配置中更改

地址:http://ip:port/player/sendCode
请求方式:post
参数:

 { 
 	email:'需要被发送验证码的邮箱' 
 }

参数格式:json
返回示例:

邮箱已经注册过了
{
message:'EMAIL EXISTES ALREARY',
code:401
}

同一个ip已经超过每天发送2条了(提示信息建议不要提及IP地址,尽量减少攻击者会换代理ip进行攻击的可能)
{
message:'SENDCODE FAIL,TRY AGAIN TOMORROW',
code:402
}

邮箱格式有问题
{
message:'INVALID ARGUMENT',
code:400
}

自服务启动起失败次数已经达到最大阈值
{
message:'STOP SENDEMAIL SERVICE',
code:403
}

发送成功
{
message:'SENDCODE SUCCESS',
code:200
}

发送失败
{
message:'SENDCODE FAIL',
code:406
}

3.注册接口

地址:http://ip:port/player/register
请求方式:post
参数:

{ 
	username:'用户名', 
	password:'密码', 
	comfirm_password:'确认密码',
	email:'邮箱地址',
	email_code:'发送的邮箱验证码'
}

参数格式:json
返回示例:

注册成功
{ code:200, message:'SUCCESS' }

错误示例:

1.邮箱已经注册过
{message:'EMAIL WAS EXISTES ALREARY',code:401}

2.邮箱验证码输入错误
{ message:'WRONG EMAILCODE',code:402}

3.用户名已经存在
{message:'USERNAME WAS EXISTED ALEARLY',code:403}

4.用户名,密码,确认密码,邮箱,邮箱验证码任意一个为空,或者密码和确认密码不一致或者邮箱格式错误
{ message:'INVALID ARGUMENT', code:400 }

@AnAloneJaver AnAloneJaver added the feature-request User Feature Request label Aug 5, 2022
@Small-Miao Small-Miao added feature Dev Feature and removed feature-request User Feature Request labels Aug 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Dev Feature
Projects
None yet
Development

No branches or pull requests

2 participants